diff options
author | tkellner <tkellner@174cde9d-5d70-4d2a-aa98-46368bc2aaf7> | 2013-04-10 19:40:14 +0000 |
---|---|---|
committer | tkellner <tkellner@174cde9d-5d70-4d2a-aa98-46368bc2aaf7> | 2013-04-10 19:40:14 +0000 |
commit | 85f15c773e818e188e251425056ff028dc68d1be (patch) | |
tree | 407afc2a36cd26e26aa6dd23608e54fd2126b52b /pdf-over-gui/src/main/java/at/asit | |
parent | 17b9255bbafe0f696a70bc01bb31521879a24ac3 (diff) | |
download | pdf-over-85f15c773e818e188e251425056ff028dc68d1be.tar.gz pdf-over-85f15c773e818e188e251425056ff028dc68d1be.tar.bz2 pdf-over-85f15c773e818e188e251425056ff028dc68d1be.zip |
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
Diffstat (limited to 'pdf-over-gui/src/main/java/at/asit')
-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); |