diff options
author | MacDue <macdue@dueutil.tech> | 2023-06-01 20:47:51 +0100 |
---|---|---|
committer | Andreas Kling <kling@serenityos.org> | 2023-06-02 05:21:48 +0200 |
commit | 47fc91ed43cf4ae30cd7ef1e2e082e90eea70b25 (patch) | |
tree | b93881bed20e9caca35bb1671a631b82940b383a | |
parent | de9604212f7c4a9bc2607608ffd28c88e5b02072 (diff) | |
download | serenity-47fc91ed43cf4ae30cd7ef1e2e082e90eea70b25.zip |
LibWeb: Remove per path clipping for SVGGeometryPaintable
Somewhere the path bounding box in the layout and the actual draw path
are getting slightly mismatched. This results in partly clipped bits of
SVGs. The paths are already clipped to the containing SVG, and the size
of the path in the layout is computed from the bounding box, so it is
probably safe just to remove this clipping for now.
-rw-r--r-- | Userland/Libraries/LibWeb/Painting/SVGGeometryPaintable.cpp | 4 |
1 files changed, 1 insertions, 3 deletions
diff --git a/Userland/Libraries/LibWeb/Painting/SVGGeometryPaintable.cpp b/Userland/Libraries/LibWeb/Painting/SVGGeometryPaintable.cpp index 7fc3076b39..979a59fbf3 100644 --- a/Userland/Libraries/LibWeb/Painting/SVGGeometryPaintable.cpp +++ b/Userland/Libraries/LibWeb/Painting/SVGGeometryPaintable.cpp @@ -65,13 +65,11 @@ void SVGGeometryPaintable::paint(PaintContext& context, PaintPhase phase) const auto const* svg_element = geometry_element.first_ancestor_of_type<SVG::SVGSVGElement>(); auto maybe_view_box = svg_element->view_box(); - context.painter().add_clip_rect(context.enclosing_device_rect(absolute_rect()).to_type<int>()); - auto css_scale = context.device_pixels_per_css_pixel(); - auto transform = layout_box().layout_transform(); if (!transform.has_value()) return; + auto css_scale = context.device_pixels_per_css_pixel(); auto paint_transform = Gfx::AffineTransform {}.scale(css_scale, css_scale).multiply(*transform); auto const& original_path = const_cast<SVG::SVGGeometryElement&>(geometry_element).get_path(); Gfx::Path path = original_path.copy_transformed(paint_transform); |