diff options
Diffstat (limited to 'pdf-over-gui/src/main/java')
-rw-r--r-- | pdf-over-gui/src/main/java/at/asit/pdfover/gui/composites/SignaturePanel.java | 8 |
1 files changed, 6 insertions, 2 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 4356ca96..b4933cb2 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 @@ -261,8 +261,12 @@ public class SignaturePanel extends JPanel { null, this); // calculate the transform from page to screen space - this.currentXform = this.currentPage.getInitialTransform(pageSize.width, - pageSize.height, null); + this.currentXform = new AffineTransform(1, 0, 0, -1, 0, pageSize.height); + Rectangle2D clip = this.currentPage.getBBox(); + double scaleX = pageSize.width / clip.getWidth(); + double scaleY = pageSize.height / clip.getHeight(); + this.currentXform.scale(scaleX, scaleY); + this.currentXform.translate(-clip.getMinX(), -clip.getMinY()); if (this.sigPagePos != null) this.sigScreenPos = this.currentXform.transform(this.sigPagePos, this.sigScreenPos); |