You are viewing a plain text version of this content. The canonical link for it is here.
Posted to fop-commits@xmlgraphics.apache.org by me...@apache.org on 2012/11/05 17:31:40 UTC
svn commit: r1405867 - in /xmlgraphics/fop/trunk:
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
Author: mehdi
Date: Mon Nov 5 16:31:40 2012
New Revision: 1405867
URL: http://svn.apache.org/viewvc?rev=1405867&view=rev
Log:
Reduced the dashed border ratio to make it more aesthetically pleasing
Modified:
xmlgraphics/fop/trunk/src/java/org/apache/fop/render/intermediate/BorderPainter.java
xmlgraphics/fop/trunk/test/java/org/apache/fop/render/pdf/PDFBorderPainterTestCase.java
xmlgraphics/fop/trunk/test/java/org/apache/fop/render/ps/PSBorderPainterTestCase.java
Modified: xmlgraphics/fop/trunk/src/java/org/apache/fop/render/intermediate/BorderPainter.java
URL: http://svn.apache.org/viewvc/xmlgraphics/fop/trunk/src/java/org/apache/fop/render/intermediate/BorderPainter.java?rev=1405867&r1=1405866&r2=1405867&view=diff
==============================================================================
--- xmlgraphics/fop/trunk/src/java/org/apache/fop/render/intermediate/BorderPainter.java (original)
+++ xmlgraphics/fop/trunk/src/java/org/apache/fop/render/intermediate/BorderPainter.java Mon Nov 5 16:31:40 2012
@@ -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;
Modified: xmlgraphics/fop/trunk/test/java/org/apache/fop/render/pdf/PDFBorderPainterTestCase.java
URL: http://svn.apache.org/viewvc/xmlgraphics/fop/trunk/test/java/org/apache/fop/render/pdf/PDFBorderPainterTestCase.java?rev=1405867&r1=1405866&r2=1405867&view=diff
==============================================================================
--- xmlgraphics/fop/trunk/test/java/org/apache/fop/render/pdf/PDFBorderPainterTestCase.java (original)
+++ xmlgraphics/fop/trunk/test/java/org/apache/fop/render/pdf/PDFBorderPainterTestCase.java Mon Nov 5 16:31:40 2012
@@ -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() {
Modified: xmlgraphics/fop/trunk/test/java/org/apache/fop/render/ps/PSBorderPainterTestCase.java
URL: http://svn.apache.org/viewvc/xmlgraphics/fop/trunk/test/java/org/apache/fop/render/ps/PSBorderPainterTestCase.java?rev=1405867&r1=1405866&r2=1405867&view=diff
==============================================================================
--- xmlgraphics/fop/trunk/test/java/org/apache/fop/render/ps/PSBorderPainterTestCase.java (original)
+++ xmlgraphics/fop/trunk/test/java/org/apache/fop/render/ps/PSBorderPainterTestCase.java Mon Nov 5 16:31:40 2012
@@ -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() {
---------------------------------------------------------------------
To unsubscribe, e-mail: fop-commits-unsubscribe@xmlgraphics.apache.org
For additional commands, e-mail: fop-commits-help@xmlgraphics.apache.org