mirror of
https://github.com/zebrajr/ladybird.git
synced 2025-12-06 00:19:53 +01:00
LibWeb: Simplify calculation of the SVG viewbox transform
We don't need to construct a new AffineTransform and multiply that by yet another AffineTransform; we can simply translate and scale the transform that's already in place. No functional changes.
This commit is contained in:
parent
6f50c35d68
commit
beb1d60714
|
|
@ -235,10 +235,10 @@ void SVGFormattingContext::run(AvailableSpace const& available_space)
|
|||
auto viewbox_offset_and_scale = scale_and_align_viewbox_content(preserve_aspect_ratio, *active_view_box, { scale_width, scale_height }, svg_box_state);
|
||||
|
||||
CSSPixelPoint offset = viewbox_offset_and_scale.offset;
|
||||
m_current_viewbox_transform = Gfx::AffineTransform { m_current_viewbox_transform }.multiply(Gfx::AffineTransform {}
|
||||
.translate(offset.to_type<float>())
|
||||
.scale(viewbox_offset_and_scale.scale_factor_x, viewbox_offset_and_scale.scale_factor_y)
|
||||
.translate({ -active_view_box->min_x, -active_view_box->min_y }));
|
||||
m_current_viewbox_transform
|
||||
.translate(offset.to_type<float>())
|
||||
.scale(viewbox_offset_and_scale.scale_factor_x, viewbox_offset_and_scale.scale_factor_y)
|
||||
.translate({ -active_view_box->min_x, -active_view_box->min_y });
|
||||
}
|
||||
|
||||
if (svg_box_state.has_definite_width() && svg_box_state.has_definite_height()) {
|
||||
|
|
|
|||
Loading…
Reference in New Issue
Block a user