mirror of
https://github.com/LadybirdBrowser/ladybird.git
synced 2025-12-07 21:59:54 +00: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
Notes:
github-actions[bot]
2025-10-27 23:43:31 +00:00
Author: https://github.com/gmta
Commit: beb1d60714
Pull-request: https://github.com/LadybirdBrowser/ladybird/pull/6592
1 changed files with 4 additions and 4 deletions
|
|
@ -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…
Add table
Add a link
Reference in a new issue