LibWeb: Use transform-box for resolving percentage transform values

Factor out computing the transform box rect into its own method. Then
use it when resolving the transformation matrix, to compute percentage
values.
This commit is contained in:
BenJilks 2024-09-05 15:15:17 +01:00 committed by Alexander Kalenik
commit 7e38e12bb0
Notes: github-actions[bot] 2024-09-05 23:35:41 +00:00
5 changed files with 92 additions and 65 deletions

View file

@ -47,7 +47,7 @@ ErrorOr<Gfx::FloatMatrix4x4> Transformation::to_matrix(Optional<Painting::Painta
CSSPixels width = 1;
CSSPixels height = 1;
if (paintable_box.has_value()) {
auto reference_box = paintable_box->absolute_padding_box_rect();
auto reference_box = paintable_box->transform_box_rect();
width = reference_box.width();
height = reference_box.height();
}