thorvg / thorvg

Thor Vector Graphics is a lightweight portable library used for drawing vector-based scenes and animations including SVG and Lottie. It can be freely utilized across various software platforms and applications to visualize graphical contents.

Home Page:https://www.thorvg.org

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

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

MewPurPur opened this issue · comments

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