-
Notifications
You must be signed in to change notification settings - Fork 30
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
Stroke thickness off by sqrt(2)/2 #35
Comments
@jgranick can you please comment on this? |
@jgranick @ashes999 interesting, the scale computation on line 137 is:
It's taking the hypotenuse length of the x/y scale. But for an identity matrix, this results in 1.414 (aka, sqrt(2).) so I believe we need to divide out the sqrt(2) like so:
I'm going to do a quick scaling test to see how eog/gimp/etc scale strokes. |
@jcward that bit of code was last changed in this commit, please take a look at the commit (and/or the instigating issue) and double-check that you're not re-breaking something that was fixed. |
Thanks for spending so much time on this, and for adding test cases to all your PRs. We really need to build that up to get this library more stable. |
@ashes999 no problem, I want this library to work well, and testcases is how we'll get there without regressions! :) |
@jcward if you fix one (and only one) SVG issue, I would like to suggest you pick this one. I think this is what's causing all of our existing test images to be rendered with a non-zero difference. (This also prevents us from using smaller test images, because the number of pixels changed becomes a larger percentage of the overall image...) |
Ugh, it's been sitting in PR for a while. I don't know much about the code-base, and I could accept, but I'd rather someone more experienced takes a look at your changes. Sorry, I know that's not very useful. |
Yeah, no worries, probably best to get their feedback. :) |
With a simple test SVG, I'm finding that the stroke thickness is off by a factor of sqrt(2)/2 (and, less critically, the default joint type seems to be rounded instead of miter.)
Here's the test SVG:
And this is OpenFL on the left vs eog/gimp/etc on the right:
I can hack the extra scaling factor into SVGRenderer.hx and it fixes the issue, however, I'm not sure where this extra factor should go in the lib:
The text was updated successfully, but these errors were encountered: