1
Fork 0
mirror of https://github.com/RGBCube/serenity synced 2025-07-27 11:27:35 +00:00

LibWeb: Store computed SVG path data/transforms in LayoutState

This removes the awkward hack to recompute the layout transform at paint
time, and makes it possible for path sizes to be computed during layout.

For example, it's possible to use relative units in SVG shapes (e.g.
<rect>), which can be resolved during layout, but would be hard to
resolve again during painting.
This commit is contained in:
MacDue 2023-10-29 17:08:35 +00:00 committed by Alexander Kalenik
parent 19313945f2
commit dc9cb449b1
12 changed files with 76 additions and 69 deletions

View file

@ -1,4 +1,4 @@
<svg width="200" viewBox="-10 -10 120 120">
<svg width="120" viewBox="-10 -10 120 120">
<rect x="-10" y="-10" width="120" height="120" fill="blue" />
<rect x="50" y="10" width="40" height="80" fill="red" />
</svg>

Before

Width:  |  Height:  |  Size: 175 B

After

Width:  |  Height:  |  Size: 175 B

Before After
Before After