]> source.dussan.org Git - xmlgraphics-fop.git/commitdiff
AFPGraphics2D Line drawing width (Stroke) fix.
authorAdrian Cumiskey <acumiskey@apache.org>
Wed, 5 Nov 2008 09:53:07 +0000 (09:53 +0000)
committerAdrian Cumiskey <acumiskey@apache.org>
Wed, 5 Nov 2008 09:53:07 +0000 (09:53 +0000)
git-svn-id: https://svn.apache.org/repos/asf/xmlgraphics/fop/branches/Temp_AFPGOCAResources@711545 13f79535-47bb-0310-9956-ffa450edef68

src/java/org/apache/fop/afp/AFPGraphics2D.java

index d412e2b94779125051ab58bd0b5e09d35ad16eda..190e5e46544f52baf1793c25e15f8a8a21437dc7 100644 (file)
@@ -169,11 +169,12 @@ public class AFPGraphics2D extends AbstractGraphics2D {
     protected void applyStroke(Stroke stroke) {
         if (stroke instanceof BasicStroke) {
             BasicStroke basicStroke = (BasicStroke) stroke;
+
+            // set line width
             float lineWidth = basicStroke.getLineWidth();
-            if (state.setLineWidth(lineWidth)) {
-                getGraphicsObject().setLineWidth(Math.round(lineWidth * 2));
-            }
-            // note: this is an approximation at best!
+            getGraphicsObject().setLineWidth(Math.round(lineWidth * 2));
+
+            // set line type/style (note: this is an approximation at best!)
             float[] dashArray = basicStroke.getDashArray();
             if (state.setDashArray(dashArray)) {
                 byte type = GraphicsSetLineType.DEFAULT; // normally SOLID
@@ -218,7 +219,6 @@ public class AFPGraphics2D extends AbstractGraphics2D {
      *            true if the shape is to be drawn filled
      */
     private void doDrawing(Shape shape, boolean fill) {
-        getGraphicsObject();
         if (!fill) {
             graphicsObj.newSegment();
         }