jfree / jfreesvg

A fast, lightweight Java library for creating Scalable Vector Graphics (SVG) output.
http://www.jfree.org/jfreesvg
GNU General Public License v3.0
319 stars 58 forks source link

Custom miterlimit is not applied #36

Closed christianAppl closed 3 years ago

christianAppl commented 3 years ago

Custom miterlimits are seemingly not applied, when drawing pathes. This is caused by a minor flaw in one of the if statements in "SVGGraphics2D.strokeStyle()"

The statement's (assumed) intended behaviour: Only if the absolute difference between the set miterlimit and the default miter limit(4) surpasses 0.001 a custom miter limit shall be appended to the style String.

For this reason:

It is:

if (Math.abs(DEFAULT_MITER_LIMIT - miterLimit) < 0.001) {
    b.append("stroke-miterlimit: ").append(geomDP(miterLimit));        
}

But it should be:

if (Math.abs(DEFAULT_MITER_LIMIT - miterLimit) > 0.001) {
   b.append("stroke-miterlimit: ").append(geomDP(miterLimit));        
}
jfree commented 3 years ago

Good spot, I've committed the fix.