Skip to content

Commit b83c49b

Browse files
MartinJSolesmonoman
authored andcommitted
Update SvgTextElement constructor
The constructor that accepts two floats for X and Y is implicitly converting to SvgLength objects with unknown length types. A new constructor is added to accept the correct parameter types.
1 parent 734e553 commit b83c49b

File tree

1 file changed

+8
-0
lines changed

1 file changed

+8
-0
lines changed

SvgNet/Elements/SvgTextElement.cs

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -57,13 +57,21 @@ public SvgTextElement(string s) {
5757
AddChild(tn);
5858
}
5959

60+
[Obsolete()]
6061
public SvgTextElement(string s, float x, float y) {
6162
var tn = new TextNode(s);
6263
AddChild(tn);
6364
X = x;
6465
Y = y;
6566
}
6667

68+
public SvgTextElement(string s, SvgLength x, SvgLength y) {
69+
var tn = new TextNode(s);
70+
AddChild(tn);
71+
X = x;
72+
Y = y;
73+
}
74+
6775
public override string Name => "text";
6876

6977
public string Text {

0 commit comments

Comments
 (0)