summaryrefslogtreecommitdiff
path: root/trunk/pdf-over-gui/src/main/java
diff options
context:
space:
mode:
authortkellner <tkellner@3a0b52a2-8410-0410-bc02-ff6273a87459>2012-10-31 16:36:40 +0000
committertkellner <tkellner@3a0b52a2-8410-0410-bc02-ff6273a87459>2012-10-31 16:36:40 +0000
commit6d0544c85041f2bd8ea8b079b56b9be2ccafb7ca (patch)
treef7e6b599c3d0304b204991d4117241e790fa6acf /trunk/pdf-over-gui/src/main/java
parentf91d59288641dfcb6ffadee0c6b35da7e737ab93 (diff)
downloadpdf-over-6d0544c85041f2bd8ea8b079b56b9be2ccafb7ca.tar.gz
pdf-over-6d0544c85041f2bd8ea8b079b56b9be2ccafb7ca.tar.bz2
pdf-over-6d0544c85041f2bd8ea8b079b56b9be2ccafb7ca.zip
Make sure signature stays within page
git-svn-id: https://svn.iaik.tugraz.at/svn/egiz/prj/current/12PDF-OVER-4.0@12706 3a0b52a2-8410-0410-bc02-ff6273a87459
Diffstat (limited to 'trunk/pdf-over-gui/src/main/java')
-rw-r--r--trunk/pdf-over-gui/src/main/java/at/asit/pdfover/gui/composites/SignaturePanel.java8
1 files changed, 4 insertions, 4 deletions
diff --git a/trunk/pdf-over-gui/src/main/java/at/asit/pdfover/gui/composites/SignaturePanel.java b/trunk/pdf-over-gui/src/main/java/at/asit/pdfover/gui/composites/SignaturePanel.java
index 4b33d524..d30c6bf8 100644
--- a/trunk/pdf-over-gui/src/main/java/at/asit/pdfover/gui/composites/SignaturePanel.java
+++ b/trunk/pdf-over-gui/src/main/java/at/asit/pdfover/gui/composites/SignaturePanel.java
@@ -74,9 +74,9 @@ public class SignaturePanel extends JPanel {
/** Height of the signature placeholder in page space */
private int sigPageHeight = 0;
/** Width of the signature placeholder in screen space */
- private int sigScreenWidth = 0;
+ int sigScreenWidth = 0;
/** Height of the signature placeholder in screen space */
- private int sigScreenHeight = 0;
+ int sigScreenHeight = 0;
/**
* Create a new PagePanel, with a default size of 800 by 600 pixels.
@@ -282,9 +282,9 @@ public class SignaturePanel extends JPanel {
if (SignaturePanel.this.currentImage == null)
return;
sigx -= SignaturePanel.this.offX;
- sigx = clamp(sigx, 0, SignaturePanel.this.currentImage.getWidth(null));
+ sigx = clamp(sigx, 0, SignaturePanel.this.currentImage.getWidth(null) - SignaturePanel.this.sigScreenWidth);
sigy -= SignaturePanel.this.offY;
- sigy = clamp(sigy, 0, SignaturePanel.this.currentImage.getHeight(null));
+ sigy = clamp(sigy, 0, SignaturePanel.this.currentImage.getHeight(null) - SignaturePanel.this.sigScreenHeight);
SignaturePanel.this.sigScreenPos = new Point2D.Double(sigx, sigy);
SignaturePanel.this.sigPagePos = SignaturePanel.this.currentXform.transform(SignaturePanel.this.sigScreenPos, SignaturePanel.this.sigPagePos);
repaint();