LibWeb: Apply the paint transformation in SVGGradientElement

In commit 1b82cb43c2 I accidentally
removed the paint transformation altogether. The result was that
zoomed-in SVGs, or SVG elements with a transformation applied could have
their gradient coordinates misplaced significantly.

This was also exposed in the `svg-text-effects` test by way of a slight
visual difference. Add a new test that very clearly exposes the fixed
issue by rotating the gradient coordinates by 45 degrees.
This commit is contained in:
Jelle Raaijmakers 2024-11-15 14:41:15 +01:00 committed by Andreas Kling
parent e21b5cab32
commit e5d71a6c82
Notes: github-actions[bot] 2024-11-15 22:37:58 +00:00
7 changed files with 25 additions and 1 deletions

View file

@ -84,7 +84,7 @@ Optional<Gfx::AffineTransform> SVGGradientElement::gradient_transform_impl(HashT
// The gradient transform, appropriately scaled and combined with the paint transform.
Gfx::AffineTransform SVGGradientElement::gradient_paint_transform(SVGPaintContext const& paint_context) const
{
Gfx::AffineTransform gradient_paint_transform;
Gfx::AffineTransform gradient_paint_transform = paint_context.paint_transform;
auto const& bounding_box = paint_context.path_bounding_box;
if (gradient_units() == SVGUnits::ObjectBoundingBox) {