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:
parent
d9c842a83f
commit
883f44d397
4 changed files with 60 additions and 48 deletions
|
@ -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;
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue