jfreesvg icon indicating copy to clipboard operation
jfreesvg copied to clipboard

Zero "0" stroke width objects cannot be handled correctly in SVGGraphics2D, a default value of stroke-width:0.1 in svg export will be returned

Open istinnstudio opened this issue 1 year ago • 0 comments

Hi.., in a loop of shapes if I use "Stroke randomStroke = new BasicStroke(randomStrokeWidth); " if width will be set to zero, at the end I get stroked shapes with a rendered default width 0.1f. Instead it should export "no stroke". Batik exports ok the same graphics2D object, without rendering the stroke by setting: stroke-width:0.

SVGGraphics2D source constructor this.zeroStrokeWidth = 0.1; and at the end we get stroke-width:0.1 with all zero width objects

So In this case, I could set my minimum width to something like near zero .. 0.000001f and svg export is ok, as a workaround. But zero should be handled, maybe should be clearer if just use 0f instead of 0.1f in the constructor default value. Thanks

istinnstudio avatar Nov 29 '24 20:11 istinnstudio