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

SVG stroke-width with a percentage uses the width instead of the diagonal over sqrt(2). #2131

Open
MewPurPur opened this issue Apr 2, 2024 · 0 comments
Labels
bug Something isn't working svg SVG features

Comments

@MewPurPur
Copy link
Collaborator

MewPurPur commented Apr 2, 2024

https://svgwg.org/svg2-draft/painting.html#StrokeWidth

image

Example: <svg width="100" height="50" xmlns="http://www.w3.org/2000/svg"><rect x="15" y="15" width="70" height="20" fill="none" stroke="#def" stroke-width="10%"/><rect x="15" y="15" width="70" height="20" fill="none" stroke="#fac" stroke-opacity=".6" stroke-width="10"/></svg>

Conforming to the SVG specification, 10% should amount to ~7.9px, as shown below - the two rects don't perfectly align. This isn't the case if you test this with ThorVG viewer right now. There may be more attributes with this flaw.

image

@MewPurPur MewPurPur changed the title [SVG] stroke-width with a percentage uses the width instead of the normalized diagonal. SVG stroke-width with a percentage uses the width instead of the diagonal over sqrt(2). Apr 2, 2024
@MewPurPur MewPurPur added bug Something isn't working svg SVG features labels Apr 2, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working svg SVG features
Projects
Status: No status
Development

No branches or pull requests

1 participant