From 7ffcbe20394fd0626582acbd3a1e174b98d1ccb8 Mon Sep 17 00:00:00 2001 From: tkellner Date: Wed, 10 Apr 2013 19:05:05 +0000 Subject: Make sure signature stays within page git-svn-id: https://joinup.ec.europa.eu/svn/pdf-over/trunk@120 174cde9d-5d70-4d2a-aa98-46368bc2aaf7 --- .../main/java/at/asit/pdfover/gui/composites/SignaturePanel.java | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) (limited to 'pdf-over-gui/src/main/java/at') 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(); -- cgit v1.2.3