Skip to content

SVG: draw the stroke under the fill for paint-order stroke - #2203

Open
RavSinghChandan wants to merge 2 commits into
py-pdf:masterfrom
RavSinghChandan:svg-paint-order
Open

RavSinghChandan wants to merge 2 commits into
py-pdf:masterfrom
RavSinghChandan:svg-paint-order

Conversation

@RavSinghChandan

Copy link
Copy Markdown

Inkscape writes paint-order="markers stroke fill" on shapes whose stroke should be drawn under the fill, as in the pyproj logo. fpdf2 ignores the property and always draws the fill and then the stroke, so half of the stroke covers the fill and it looks twice as wide.

A shape, path or text whose paint-order puts the stroke before the fill is now drawn as a copy with only its stroke, then a copy with only its fill, as in browsers. The property is inherited, so a group can set it, and a <use> of such an element keeps it.

test_svg_paint_order and test_svg_paint_order_of_a_use cover these; six of the eight cases fail without the change.

This branch has not been deployed

No deployments
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

Successfully merging this pull request may close these issues.

1 participant