From 6d0544c85041f2bd8ea8b079b56b9be2ccafb7ca Mon Sep 17 00:00:00 2001 From: tkellner Date: Wed, 31 Oct 2012 16:36:40 +0000 Subject: 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 --- .../main/java/at/asit/pdfover/gui/composites/SignaturePanel.java | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) (limited to 'trunk/pdf-over-gui/src') 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(); -- cgit v1.2.3