-
Notifications
You must be signed in to change notification settings - Fork 305
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
extra 1px
@ bottom and/or left within code128
[toSVG]
#330
Comments
.replace(/(?<=viewBox=")(0) (0) ([0-9]+) ([0-9]+)(?=")/,
(match, p1, p2, p3, p4) => {return (++p1)+' '+(p2)+' '+(--p3)+' '+(--p4)}) |
1px
extra height @ code128
[toSVG]1px
@ bottom and/or left within code128
[toSVG]
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. |
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 |
@ |
The text was updated successfully, but these errors were encountered: