Open xerc opened 6 months ago
.replace(/(?<=viewBox=")(0) (0) ([0-9]+) ([0-9]+)(?=")/,
(match, p1, p2, p3, p4) => {return (++p1)+' '+(p2)+' '+(--p3)+' '+(--p4)})
This was a legitimate issue - not sure why you closed it. Although the issue was not the viewBox sizing - some of the SVG drawing primitives were off by one compared to the built-in drawing. Also the text layout had several issues. v4.3.1 provides the fixes.
Manually comparing the images produced by the built-in canvas render vs SVG using the project's demo.html, there is now no perceptible difference.
might this also be an issue? scale:5
=> fine @ scale:10
top SVG & CANVAS bottom (right corner)
Found the root of this issue. It is the combination of scale factor and stroke width. The svg drawing adjusts coordinates by 0.5px when stroke width is odd, which gives crisp lines by avoiding anti-aliasing. But apparently, it needs to subtract 0.5 when scale is odd, and add 0.5 when scale is even. I will have a release for this later today or tomorrow.
idea/ theoretical for SVG 1px can be 1px cause scaling can happen later => ignore scale
and maybee even width