MCPcopy Create free account
hub / github.com/9chu/LuaSTGPlus / XmlElementToRectangleF

Method XmlElementToRectangleF

TexturedFontEditor/Helper.cs:126–139  ·  view source on GitHub ↗
(XmlElement Node, string NodeName, string Attribute = "Value")

Source from the content-addressed store, hash-verified

124 }
125
126 public static RectangleF XmlElementToRectangleF(XmlElement Node, string NodeName, string Attribute = "Value")
127 {
128 string[] tRectArr = Helper.GetXmlResValue(Node, NodeName, Attribute).Split(',');
129
130 if (tRectArr.Length != 4)
131 throw new Exception("'" + NodeName + "'属性格式不正确: 请确保为'x1,y1,x2,y2'.");
132
133 return new RectangleF(
134 Convert.ToSingle(tRectArr[0]),
135 Convert.ToSingle(tRectArr[1]),
136 Convert.ToSingle(tRectArr[2]) - Convert.ToSingle(tRectArr[0]),
137 Convert.ToSingle(tRectArr[3]) - Convert.ToSingle(tRectArr[1])
138 );
139 }
140
141 public static void WriteFSTGXmlType(XmlDocument XmlDoc, string TargetFile)
142 {

Callers

nothing calls this directly

Calls 1

GetXmlResValueMethod · 0.80

Tested by

no test coverage detected