77*/
88
99using System ;
10+
1011using SvgNet . SvgTypes ;
1112
1213namespace SvgNet . SvgElements {
13- public abstract class SvgBaseTextElement : SvgStyledTransformedElement {
14- public SvgLength DX {
15- get => ( SvgLength ) _atts [ "dx" ] ;
16- set => _atts [ "dx" ] = value ;
17- }
18-
19- public SvgLength DY {
20- get => ( SvgLength ) _atts [ "dy" ] ;
21- set => _atts [ "dy" ] = value ;
22- }
23-
24- public string LengthAdjust {
25- get => ( string ) _atts [ "lengthAdjust" ] ;
26- set => _atts [ "lengthAdjust" ] = value ;
27- }
28-
29- public SvgNumList Rotate {
30- get => ( SvgNumList ) _atts [ "rotate" ] ;
31- set => _atts [ "rotate" ] = value ;
32- }
33-
34- public SvgLength X {
35- get => ( SvgLength ) _atts [ "x" ] ;
36- set => _atts [ "x" ] = value ;
37- }
38-
39- public SvgLength Y {
40- get => ( SvgLength ) _atts [ "y" ] ;
41- set => _atts [ "y" ] = value ;
42- }
43- }
4414
4515 /// <summary>
4616 /// Represents a <c>text</c> element. The SVG text element is unusual in that it expects actual XML text nodes below
@@ -49,6 +19,7 @@ public SvgLength Y {
4919 /// to XML slightly differently.
5020 /// </summary>
5121 public class SvgTextElement : SvgBaseTextElement , IElementWithText {
22+
5223 public SvgTextElement ( ) {
5324 }
5425
@@ -57,7 +28,7 @@ public SvgTextElement(string s) {
5728 AddChild ( tn ) ;
5829 }
5930
60- [ Obsolete ( ) ]
31+ [ Obsolete ( "Must pass SvgLength, for x and y, which specifies a unit. Use the new constructor override" ) ]
6132 public SvgTextElement ( string s , float x , float y ) {
6233 var tn = new TextNode ( s ) ;
6334 AddChild ( tn ) ;
@@ -84,51 +55,4 @@ public SvgLength TextLength {
8455 set => _atts [ "textLength" ] = value ;
8556 }
8657 }
87-
88- /// <summary>
89- /// Represents a <c>tref</c> element.
90- /// </summary>
91- [ Obsolete ( "Don't use it anymore" ) ]
92- public class SvgTrefElement : SvgBaseTextElement , IElementWithXRef {
93- public SvgTrefElement ( ) {
94- }
95-
96- public SvgTrefElement ( string href ) => Href = href ;
97-
98- public SvgTrefElement ( string href , float x , float y ) {
99- Href = href ;
100- X = x ;
101- Y = y ;
102- }
103-
104- public string Href {
105- get => ( string ) _atts [ "xlink:href" ] ;
106- set => _atts [ "xlink:href" ] = value ;
107- }
108-
109- public override string Name => "tref" ;
110-
111- public SvgXRef XRef {
112- get => new ( this ) ;
113- set => value . WriteToElement ( this ) ;
114- }
115- }
116-
117- /// <summary>
118- /// Represents a <c>tspan</c> element. The tspan element is unique in that it expects actual XML text nodes below
119- /// it, rather than consisting only of attributes and child elements. <c>SvgTextElement</c> therefore has to be serialized
120- /// to XML slightly differently.
121- /// </summary>
122- public class SvgTspanElement : SvgTextElement {
123- public SvgTspanElement ( ) {
124- }
125-
126- public SvgTspanElement ( string s ) : base ( s ) {
127- }
128-
129- public SvgTspanElement ( string s , float x , float y ) : base ( s , x , y ) {
130- }
131-
132- public override string Name => "tspan" ;
133- }
134- }
58+ }
0 commit comments