mirror of
https://github.com/LadybirdBrowser/ladybird.git
synced 2025-08-21 18:00:16 +00:00
LibWeb: Allow percentages on CSS transform scale functions
This commit is contained in:
parent
57ea3e160a
commit
c443f80137
Notes:
sideshowbarker
2024-07-17 10:08:28 +09:00
Author: https://github.com/bplaat
Commit: c443f80137
Pull-request: https://github.com/SerenityOS/serenity/pull/22601
Reviewed-by: https://github.com/nico
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