]> source.dussan.org Git - xmlgraphics-fop.git/commitdiff
Bugfix: The generation of the PDF "d" (setdash) command was assuming that only intege...
authorJeremias Maerki <jeremias@apache.org>
Tue, 18 Apr 2006 12:36:58 +0000 (12:36 +0000)
committerJeremias Maerki <jeremias@apache.org>
Tue, 18 Apr 2006 12:36:58 +0000 (12:36 +0000)
git-svn-id: https://svn.apache.org/repos/asf/xmlgraphics/fop/trunk@394928 13f79535-47bb-0310-9956-ffa450edef68

src/java/org/apache/fop/svg/PDFGraphics2D.java
status.xml

index 1709caba79cf778cea8e711ced644f3a9eeed4eb..a563449de47ea0c170bf8b81b744fe8ef8f6f7eb 100644 (file)
@@ -1271,20 +1271,14 @@ public class PDFGraphics2D extends AbstractGraphics2D {
             if (da != null) {
                 currentStream.write("[");
                 for (int count = 0; count < da.length; count++) {
-                    if (((int)da[count]) == 0) {
-                        // the dasharray units in pdf are (whole) numbers
-                        // in user space units, cannot be 0
-                        currentStream.write("1");
-                    } else {
-                        currentStream.write("" + ((int)da[count]));
-                    }
+                    currentStream.write(PDFNumber.doubleOut(da[count]));
                     if (count < da.length - 1) {
                         currentStream.write(" ");
                     }
                 }
                 currentStream.write("] ");
                 float offset = bs.getDashPhase();
-                currentStream.write(((int)offset) + " d\n");
+                currentStream.write(PDFNumber.doubleOut(offset) + " d\n");
             }
             int ec = bs.getEndCap();
             switch (ec) {
index cfd0bd3593e77c4232344e5525da0f95f777ef0d..df22fdf1a3eaaf301ce3a7d594d44d271b1bd9a6 100644 (file)
 
   <changes>
     <release version="FOP Trunk">
+      <action context="Code" dev="JM" type="fix">
+        Bugfix: The generation of the PDF "d" (setdash) command was assuming that
+        only integer values can be used but that isn't the case. Dash patterns 
+        PDFGraphics2D would be wrong in the process.
+      </action>
       <action context="Code" dev="JM" type="fix">
         Bugfix: Fixed a division by zero problem in TTFReader and improved the detection
         of the capHeight and xHeight font metric values for TrueType fonts.