]> source.dussan.org Git - xmlgraphics-fop.git/commitdiff
Reduced the dashed border ratio to make it more aesthetically pleasing
authorMehdi Houshmand <mehdi@apache.org>
Mon, 5 Nov 2012 16:31:40 +0000 (16:31 +0000)
committerMehdi Houshmand <mehdi@apache.org>
Mon, 5 Nov 2012 16:31:40 +0000 (16:31 +0000)
git-svn-id: https://svn.apache.org/repos/asf/xmlgraphics/fop/trunk@1405867 13f79535-47bb-0310-9956-ffa450edef68

src/java/org/apache/fop/render/intermediate/BorderPainter.java
test/java/org/apache/fop/render/pdf/PDFBorderPainterTestCase.java
test/java/org/apache/fop/render/ps/PSBorderPainterTestCase.java

index d63c4534bfc26af1b3de810c201f8013c52a8f6a..3653dd1f37e6ab46818b43512a24cb751ad0ee7d 100644 (file)
@@ -58,8 +58,8 @@ public class BorderPainter {
 
     /** The ratio between a solid dash and the white-space in a dashed-border */
     public static final float DASHED_BORDER_SPACE_RATIO = 0.5f;
-    /** The length of the dash as a factor of the border width i.e. 4 -> dashWidth = 4*borderWidth */
-    protected static final float DASHED_BORDER_LENGTH_FACTOR = 4.0f;
+    /** The length of the dash as a factor of the border width i.e. 2 -> dashWidth = 2*borderWidth */
+    protected static final float DASHED_BORDER_LENGTH_FACTOR = 2.0f;
 
     private final GraphicsPainter graphicsPainter;
 
index f45cd162e52101c94e92e03311a506e5e8bf762b..6bb6da2d8945b313959f41d11d58c84fd82cfee5 100644 (file)
@@ -46,8 +46,8 @@ public class PDFBorderPainterTestCase {
 
     /**
      * This test will fail if either of the below statements isn't true:
-     * org.apache.fop.render.intermediate.BorderPainter.DASHED_BORDER_SPACE_RATIO = 0.5f:q
-     * org.apache.fop.render.intermediate.BorderPainter.DASHED_BORDER_LENGTH_FACTOR = 4.0f.
+     * org.apache.fop.render.intermediate.BorderPainter.DASHED_BORDER_SPACE_RATIO = 0.5f
+     * org.apache.fop.render.intermediate.BorderPainter.DASHED_BORDER_LENGTH_FACTOR = 2.0f.
      */
     @Test
     public void testDrawBorderLine() throws Exception {
@@ -56,7 +56,7 @@ public class PDFBorderPainterTestCase {
         generator.flushPDFDoc();
         OutputStream outStream = new ByteArrayOutputStream();
         outStream = generator.getStream().getBufferOutputStream();
-        assertTrue(((ByteArrayOutputStream) outStream).toString().contains("[2] 0 d 1 w"));
+        assertTrue(((ByteArrayOutputStream) outStream).toString().contains("[2.105263 1.052632] 0 d 1 w"));
     }
 
     public void tearDown() {
index 44c5a468e022feabd8104a42b375ae0bb4b9605c..a83cd53e0f46007ba18c6fd8dfd7a4a24b8c0988 100644 (file)
@@ -53,7 +53,7 @@ public class PSBorderPainterTestCase {
     public void testDrawBorderLine() throws Exception {
         borderPainter.drawBorderLine(0, 0, 40000, 1000, true, true,
                 Constants.EN_DASHED, Color.BLACK);
-        assertTrue(outStream.toString().contains("[4.0 2.0] 0 setdash"));
+        assertTrue(outStream.toString().contains("[2.1052632 1.0526316] 0 setdash"));
     }
 
     public void tearDown() {