Skip to content
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

Bounding box calculations are incorrect for miter stroke joins #90

Open
adroitwhiz opened this issue Apr 29, 2019 · 0 comments
Open

Bounding box calculations are incorrect for miter stroke joins #90

adroitwhiz opened this issue Apr 29, 2019 · 0 comments

Comments

@adroitwhiz
Copy link
Contributor

Expected Behavior

SvgRenderer._transformMeasurements() should always resize the SVG's viewBox to at least the size of every element in the SVG, with no clipping.

Actual Behavior

_transformMeasurements doesn't take into account the extra bounding box space added by miter (pointy-cornered) strokes. See this test case.

This is because it compensates for getBBox() not adding stroke widths by manually enlarging the bounding box by half the largest stroke with in the SVG. This works for circular and bevel joins, but not for miter joins, which can stick out arbitrarily far depending on what the element's stroke-miterlimit is set to.

The only cross-browser way I can think of to fix this is to manually calculate the miters' bounds, but this could get messy. Any other ideas?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant