1
Fork 0
mirror of https://github.com/RGBCube/serenity synced 2025-07-26 19:17:35 +00:00

LibWeb: Use CSSPixels only when calculating radial gradient sizes

In order to do this, a function `sqrt(CSSPixels)` was added, which
currently just converts to floating point to run `AK::sqrt()`.
This commit is contained in:
Zaggy1024 2023-09-01 17:16:28 -05:00 committed by Alexander Kalenik
parent d9c842a83f
commit 883f44d397
4 changed files with 60 additions and 48 deletions

View file

@ -65,7 +65,7 @@ public:
void resolve_for_size(Layout::NodeWithStyleAndBoxModelMetrics const&, CSSPixelSize) const override;
Gfx::FloatSize resolve_size(Layout::Node const&, Gfx::FloatPoint, Gfx::FloatRect const&) const;
CSSPixelSize resolve_size(Layout::Node const&, CSSPixelPoint, CSSPixelRect const&) const;
bool is_repeating() const { return m_properties.repeating == GradientRepeating::Yes; }
@ -89,8 +89,8 @@ private:
struct ResolvedData {
Painting::RadialGradientData data;
Gfx::FloatSize gradient_size;
Gfx::FloatPoint center;
CSSPixelSize gradient_size;
CSSPixelPoint center;
};
mutable Optional<ResolvedData> m_resolved;