mirror of
https://github.com/LadybirdBrowser/ladybird.git
synced 2025-08-02 22:30:31 +00:00
LibWeb: Expose SVGCircleElement attributes to JS
This commit is contained in:
parent
b51ea3a67c
commit
1a3d6c68ef
Notes:
sideshowbarker
2024-07-17 16:52:54 +09:00
Author: https://github.com/AtkinsSJ
Commit: 1a3d6c68ef
Pull-request: https://github.com/SerenityOS/serenity/pull/13199
3 changed files with 39 additions and 3 deletions
|
@ -70,4 +70,34 @@ Gfx::Path& SVGCircleElement::get_path()
|
|||
return m_path.value();
|
||||
}
|
||||
|
||||
// https://www.w3.org/TR/SVG11/shapes.html#CircleElementCXAttribute
|
||||
NonnullRefPtr<SVGAnimatedLength> SVGCircleElement::cx() const
|
||||
{
|
||||
// FIXME: Populate the unit type when it is parsed (0 here is "unknown").
|
||||
// FIXME: Create a proper animated value when animations are supported.
|
||||
auto base_length = SVGLength::create(0, m_center_x.value_or(0));
|
||||
auto anim_length = SVGLength::create(0, m_center_x.value_or(0));
|
||||
return SVGAnimatedLength::create(move(base_length), move(anim_length));
|
||||
}
|
||||
|
||||
// https://www.w3.org/TR/SVG11/shapes.html#CircleElementCYAttribute
|
||||
NonnullRefPtr<SVGAnimatedLength> SVGCircleElement::cy() const
|
||||
{
|
||||
// FIXME: Populate the unit type when it is parsed (0 here is "unknown").
|
||||
// FIXME: Create a proper animated value when animations are supported.
|
||||
auto base_length = SVGLength::create(0, m_center_y.value_or(0));
|
||||
auto anim_length = SVGLength::create(0, m_center_y.value_or(0));
|
||||
return SVGAnimatedLength::create(move(base_length), move(anim_length));
|
||||
}
|
||||
|
||||
// https://www.w3.org/TR/SVG11/shapes.html#CircleElementRAttribute
|
||||
NonnullRefPtr<SVGAnimatedLength> SVGCircleElement::r() const
|
||||
{
|
||||
// FIXME: Populate the unit type when it is parsed (0 here is "unknown").
|
||||
// FIXME: Create a proper animated value when animations are supported.
|
||||
auto base_length = SVGLength::create(0, m_radius.value_or(0));
|
||||
auto anim_length = SVGLength::create(0, m_radius.value_or(0));
|
||||
return SVGAnimatedLength::create(move(base_length), move(anim_length));
|
||||
}
|
||||
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue