From 85f15c773e818e188e251425056ff028dc68d1be Mon Sep 17 00:00:00 2001 From: tkellner Date: Wed, 10 Apr 2013 19:40:14 +0000 Subject: Calculate own page transform to avoid rotation problems git-svn-id: https://joinup.ec.europa.eu/svn/pdf-over/trunk@444 174cde9d-5d70-4d2a-aa98-46368bc2aaf7 --- .../main/java/at/asit/pdfover/gui/composites/SignaturePanel.java | 8 ++++++-- 1 file 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); -- cgit v1.2.3