From 9d9f0a0b7e59132ec2c1c1f1ce2c63594f4219df Mon Sep 17 00:00:00 2001 From: Mehdi Houshmand Date: Mon, 5 Nov 2012 16:31:40 +0000 Subject: [PATCH] Reduced the dashed border ratio to make it more aesthetically pleasing git-svn-id: https://svn.apache.org/repos/asf/xmlgraphics/fop/trunk@1405867 13f79535-47bb-0310-9956-ffa450edef68 --- .../org/apache/fop/render/intermediate/BorderPainter.java | 4 ++-- .../org/apache/fop/render/pdf/PDFBorderPainterTestCase.java | 6 +++--- .../org/apache/fop/render/ps/PSBorderPainterTestCase.java | 2 +- 3 files changed, 6 insertions(+), 6 deletions(-) diff --git a/src/java/org/apache/fop/render/intermediate/BorderPainter.java b/src/java/org/apache/fop/render/intermediate/BorderPainter.java index d63c4534b..3653dd1f3 100644 --- a/src/java/org/apache/fop/render/intermediate/BorderPainter.java +++ b/src/java/org/apache/fop/render/intermediate/BorderPainter.java @@ -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; diff --git a/test/java/org/apache/fop/render/pdf/PDFBorderPainterTestCase.java b/test/java/org/apache/fop/render/pdf/PDFBorderPainterTestCase.java index f45cd162e..6bb6da2d8 100644 --- a/test/java/org/apache/fop/render/pdf/PDFBorderPainterTestCase.java +++ b/test/java/org/apache/fop/render/pdf/PDFBorderPainterTestCase.java @@ -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("[4 2] 0 d 1 w")); + assertTrue(((ByteArrayOutputStream) outStream).toString().contains("[2.105263 1.052632] 0 d 1 w")); } public void tearDown() { diff --git a/test/java/org/apache/fop/render/ps/PSBorderPainterTestCase.java b/test/java/org/apache/fop/render/ps/PSBorderPainterTestCase.java index 44c5a468e..a83cd53e0 100644 --- a/test/java/org/apache/fop/render/ps/PSBorderPainterTestCase.java +++ b/test/java/org/apache/fop/render/ps/PSBorderPainterTestCase.java @@ -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() { -- 2.39.5