mirror of
https://github.com/RGBCube/serenity
synced 2025-07-26 02:07:35 +00:00
LibWeb: Close all subpaths when filling SVG paths
This commit is contained in:
parent
f2881f4662
commit
6b40271b95
1 changed files with 2 additions and 2 deletions
|
@ -86,13 +86,13 @@ void SVGGeometryPaintable::paint(PaintContext& context, PaintPhase phase) const
|
||||||
auto const& original_path = const_cast<SVG::SVGGeometryElement&>(geometry_element).get_path();
|
auto const& original_path = const_cast<SVG::SVGGeometryElement&>(geometry_element).get_path();
|
||||||
Gfx::Path path = original_path.copy_transformed(paint_transform);
|
Gfx::Path path = original_path.copy_transformed(paint_transform);
|
||||||
|
|
||||||
// Fills are computed as though all paths are closed (https://svgwg.org/svg2-draft/painting.html#FillProperties)
|
// Fills are computed as though all subpaths are closed (https://svgwg.org/svg2-draft/painting.html#FillProperties)
|
||||||
auto closed_path = [&] {
|
auto closed_path = [&] {
|
||||||
// We need to fill the path before applying the stroke, however the filled
|
// We need to fill the path before applying the stroke, however the filled
|
||||||
// path must be closed, whereas the stroke path may not necessary be closed.
|
// path must be closed, whereas the stroke path may not necessary be closed.
|
||||||
// Copy the path and close it for filling, but use the previous path for stroke
|
// Copy the path and close it for filling, but use the previous path for stroke
|
||||||
auto copy = path;
|
auto copy = path;
|
||||||
copy.close();
|
copy.close_all_subpaths();
|
||||||
return copy;
|
return copy;
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue