LibWeb: Support percentage values in SVG text positioning element

This commit is contained in:
Edwin Hoksberg 2024-07-21 16:21:28 +02:00 committed by Andreas Kling
commit 356bddbdbb
Notes: github-actions[bot] 2024-07-21 17:57:31 +00:00
5 changed files with 69 additions and 12 deletions

View file

@ -18,7 +18,7 @@ class SVGTextPositioningElement : public SVGTextContentElement {
public:
virtual void attribute_changed(FlyString const& name, Optional<String> const& old_value, Optional<String> const& value) override;
Gfx::FloatPoint get_offset() const;
Gfx::FloatPoint get_offset(CSSPixelSize const& viewport_size) const;
JS::NonnullGCPtr<SVGAnimatedLength> x() const;
JS::NonnullGCPtr<SVGAnimatedLength> y() const;
@ -31,10 +31,10 @@ protected:
virtual void initialize(JS::Realm&) override;
private:
float m_x { 0 };
float m_y { 0 };
float m_dx { 0 };
float m_dy { 0 };
Optional<NumberPercentage> m_x;
Optional<NumberPercentage> m_y;
Optional<NumberPercentage> m_dx;
Optional<NumberPercentage> m_dy;
};
}