diff options
author | tkellner <tkellner@174cde9d-5d70-4d2a-aa98-46368bc2aaf7> | 2013-04-10 19:05:05 +0000 |
---|---|---|
committer | tkellner <tkellner@174cde9d-5d70-4d2a-aa98-46368bc2aaf7> | 2013-04-10 19:05:05 +0000 |
commit | 7ffcbe20394fd0626582acbd3a1e174b98d1ccb8 (patch) | |
tree | a1392ce2e261f8f81ba450708c47cbedd08dacf0 /pdf-over-gui/src/main/java/at | |
parent | 77d42ff561854f92797ac63a5e363baa9cb0af87 (diff) | |
download | pdf-over-7ffcbe20394fd0626582acbd3a1e174b98d1ccb8.tar.gz pdf-over-7ffcbe20394fd0626582acbd3a1e174b98d1ccb8.tar.bz2 pdf-over-7ffcbe20394fd0626582acbd3a1e174b98d1ccb8.zip |
Make sure signature stays within page
git-svn-id: https://joinup.ec.europa.eu/svn/pdf-over/trunk@120 174cde9d-5d70-4d2a-aa98-46368bc2aaf7
Diffstat (limited to 'pdf-over-gui/src/main/java/at')
-rw-r--r-- | pdf-over-gui/src/main/java/at/asit/pdfover/gui/composites/SignaturePanel.java | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/pdf-over-gui/src/main/java/at/asit/pdfover/gui/composites/SignaturePanel.java b/pdf-over-gui/src/main/java/at/asit/pdfover/gui/composites/SignaturePanel.java index 4b33d524..d30c6bf8 100644 --- a/pdf-over-gui/src/main/java/at/asit/pdfover/gui/composites/SignaturePanel.java +++ b/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(); |