mirror of
https://github.com/LadybirdBrowser/ladybird.git
synced 2025-08-07 00:29:15 +00:00
LibWeb/CSS: Merge TranslationStyleValue into TransformationStyleValue
As with ScaleStyleValue, the serialization is the only unique part of this class, and we can just move it over.
This commit is contained in:
parent
ac15e626dd
commit
03a4ecce19
Notes:
github-actions[bot]
2025-01-17 09:15:27 +00:00
Author: https://github.com/AtkinsSJ
Commit: 03a4ecce19
Pull-request: https://github.com/LadybirdBrowser/ladybird/pull/3263
9 changed files with 36 additions and 125 deletions
|
@ -36,7 +36,6 @@
|
|||
#include <LibWeb/CSS/StyleValues/StringStyleValue.h>
|
||||
#include <LibWeb/CSS/StyleValues/StyleValueList.h>
|
||||
#include <LibWeb/CSS/StyleValues/TransformationStyleValue.h>
|
||||
#include <LibWeb/CSS/StyleValues/TranslationStyleValue.h>
|
||||
#include <LibWeb/Layout/BlockContainer.h>
|
||||
#include <LibWeb/Layout/Node.h>
|
||||
#include <LibWeb/Platform/FontPlugin.h>
|
||||
|
@ -596,18 +595,12 @@ Optional<CSS::Transformation> ComputedProperties::rotate(Layout::Node const& lay
|
|||
return CSS::Transformation(CSS::TransformFunction::Rotate3d, move(values));
|
||||
}
|
||||
|
||||
Optional<CSS::Transformation> ComputedProperties::translate() const
|
||||
Optional<Transformation> ComputedProperties::translate() const
|
||||
{
|
||||
auto const& value = property(CSS::PropertyID::Translate);
|
||||
if (!value.is_translation())
|
||||
auto const& value = property(PropertyID::Translate);
|
||||
if (!value.is_transformation())
|
||||
return {};
|
||||
auto const& translation = value.as_translation();
|
||||
|
||||
Vector<TransformValue> values;
|
||||
values.append(translation.x());
|
||||
values.append(translation.y());
|
||||
|
||||
return CSS::Transformation(CSS::TransformFunction::Translate, move(values));
|
||||
return value.as_transformation().to_transformation();
|
||||
}
|
||||
|
||||
Optional<Transformation> ComputedProperties::scale() const
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue