@@ -55,4 +55,44 @@ Gfx::Path& SVGLineElement::get_path()
55
55
return m_path.value ();
56
56
}
57
57
58
+ // https://www.w3.org/TR/SVG11/shapes.html#LineElementX1Attribute
59
+ NonnullRefPtr<SVGAnimatedLength> SVGLineElement::x1 () const
60
+ {
61
+ // FIXME: Populate the unit type when it is parsed (0 here is "unknown").
62
+ // FIXME: Create a proper animated value when animations are supported.
63
+ auto base_length = SVGLength::create (0 , m_x1.value_or (0 ));
64
+ auto anim_length = SVGLength::create (0 , m_x1.value_or (0 ));
65
+ return SVGAnimatedLength::create (move (base_length), move (anim_length));
66
+ }
67
+
68
+ // https://www.w3.org/TR/SVG11/shapes.html#LineElementY1Attribute
69
+ NonnullRefPtr<SVGAnimatedLength> SVGLineElement::y1 () const
70
+ {
71
+ // FIXME: Populate the unit type when it is parsed (0 here is "unknown").
72
+ // FIXME: Create a proper animated value when animations are supported.
73
+ auto base_length = SVGLength::create (0 , m_y1.value_or (0 ));
74
+ auto anim_length = SVGLength::create (0 , m_y1.value_or (0 ));
75
+ return SVGAnimatedLength::create (move (base_length), move (anim_length));
76
+ }
77
+
78
+ // https://www.w3.org/TR/SVG11/shapes.html#LineElementX2Attribute
79
+ NonnullRefPtr<SVGAnimatedLength> SVGLineElement::x2 () const
80
+ {
81
+ // FIXME: Populate the unit type when it is parsed (0 here is "unknown").
82
+ // FIXME: Create a proper animated value when animations are supported.
83
+ auto base_length = SVGLength::create (0 , m_x2.value_or (0 ));
84
+ auto anim_length = SVGLength::create (0 , m_x2.value_or (0 ));
85
+ return SVGAnimatedLength::create (move (base_length), move (anim_length));
86
+ }
87
+
88
+ // https://www.w3.org/TR/SVG11/shapes.html#LineElementY2Attribute
89
+ NonnullRefPtr<SVGAnimatedLength> SVGLineElement::y2 () const
90
+ {
91
+ // FIXME: Populate the unit type when it is parsed (0 here is "unknown").
92
+ // FIXME: Create a proper animated value when animations are supported.
93
+ auto base_length = SVGLength::create (0 , m_y2.value_or (0 ));
94
+ auto anim_length = SVGLength::create (0 , m_y2.value_or (0 ));
95
+ return SVGAnimatedLength::create (move (base_length), move (anim_length));
96
+ }
97
+
58
98
}
0 commit comments