1
Fork 0
mirror of https://github.com/RGBCube/serenity synced 2025-05-31 13:28:11 +00:00

LibWeb: Fix end position for objectBoundingBox SVG <radialGradient>s

The translation to the bounding box location is handled by the gradient
transform, also doing it here breaks things.

This fixes the MDN <radialGradient> example.
This commit is contained in:
MacDue 2023-06-17 19:25:54 +01:00 committed by Sam Atkins
parent 57626c4f9a
commit a910c4d984
2 changed files with 20 additions and 4 deletions

View file

@ -136,11 +136,9 @@ Optional<Gfx::PaintStyle const&> SVGRadialGradientElement::to_gfx_paint_style(SV
// is established using the bounding box of the element to which the gradient is applied (see Object bounding box units)
// and then applying the transform specified by attribute gradientTransform. Percentages represent values relative
// to the bounding box for the object.
start_center = Gfx::FloatPoint {
start_circle_x().value(), start_circle_y().value()
};
start_center = Gfx::FloatPoint { start_circle_x().value(), start_circle_y().value() };
start_radius = start_circle_radius().value();
end_center = paint_context.path_bounding_box.location() + Gfx::FloatPoint { end_circle_x().value(), end_circle_y().value() };
end_center = Gfx::FloatPoint { end_circle_x().value(), end_circle_y().value() };
end_radius = end_circle_radius().value();
} else {
// GradientUnits::UserSpaceOnUse