mirror of
https://github.com/RGBCube/serenity
synced 2025-07-25 20:57:35 +00:00
LibWeb: Allow percentages on CSS transform scale functions
This commit is contained in:
parent
57ea3e160a
commit
c443f80137
9 changed files with 63 additions and 11 deletions
|
@ -35,8 +35,10 @@ ErrorOr<Gfx::FloatMatrix4x4> Transformation::to_matrix(Optional<Painting::Painta
|
|||
return value.value().to_radians();
|
||||
return Error::from_string_literal("Transform contains non absolute units");
|
||||
},
|
||||
[](double value) -> ErrorOr<float> {
|
||||
return value;
|
||||
[&](CSS::NumberPercentage const& value) -> ErrorOr<float> {
|
||||
if (value.is_percentage())
|
||||
return value.percentage().as_fraction();
|
||||
return value.number().value();
|
||||
});
|
||||
};
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue