diff options
author | Jeremias Maerki <jeremias@apache.org> | 2005-08-27 21:47:36 +0000 |
---|---|---|
committer | Jeremias Maerki <jeremias@apache.org> | 2005-08-27 21:47:36 +0000 |
commit | b9e448c3e13907d2e87af092f7965bbccc8332d1 (patch) | |
tree | cd84226bcc59fdeabd6744745bbb56a238faca4b | |
parent | e0b2d7135d9da2efd5dde48200121cfd500367c8 (diff) | |
download | xmlgraphics-fop-b9e448c3e13907d2e87af092f7965bbccc8332d1.tar.gz xmlgraphics-fop-b9e448c3e13907d2e87af092f7965bbccc8332d1.zip |
Bugzilla #36391:
Fix for negative values for reference orientation. CTM was wrong.
Submitted by: Yannick Valot <yvalot.at.gmail.com>
git-svn-id: https://svn.apache.org/repos/asf/xmlgraphics/fop/trunk@240459 13f79535-47bb-0310-9956-ffa450edef68
-rw-r--r-- | src/java/org/apache/fop/area/CTM.java | 11 |
1 files changed, 7 insertions, 4 deletions
diff --git a/src/java/org/apache/fop/area/CTM.java b/src/java/org/apache/fop/area/CTM.java index b959bbf6d..ca2a79ff8 100644 --- a/src/java/org/apache/fop/area/CTM.java +++ b/src/java/org/apache/fop/area/CTM.java @@ -1,5 +1,5 @@ /* - * Copyright 1999-2004 The Apache Software Foundation. + * Copyright 1999-2005 The Apache Software Foundation. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -157,13 +157,13 @@ public class CTM implements Serializable { */ public CTM rotate(double angle) { double cos, sin; - if (angle == 90.0) { + if (angle == 90.0 || angle == -270.0) { cos = 0.0; sin = 1.0; - } else if (angle == 270.0) { + } else if (angle == 270.0 || angle == -90.0) { cos = 0.0; sin = -1.0; - } else if (angle == 180.0) { + } else if (angle == 180.0 || angle == -180.0) { cos = -1.0; sin = 0.0; } else { @@ -283,12 +283,15 @@ public class CTM implements Serializable { // first quadrant. Note: rotation is counter-clockwise switch (absRefOrient) { case 90: + case -270: ctm = ctm.translate(0, width); // width = absVPrect.height break; case 180: + case -180: ctm = ctm.translate(width, height); break; case 270: + case -90: ctm = ctm.translate(height, 0); // height = absVPrect.width break; } |