Skip to content

Commit bf1fb69

Browse files
committed
fix(rect): Allow the usage of spaces for components of a Rect (used in a <RectangleGeometry>)
1 parent 071f1aa commit bf1fb69

File tree

1 file changed

+7
-1
lines changed

1 file changed

+7
-1
lines changed

src/Uno.Foundation/Rect.cs

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -107,9 +107,15 @@ public static implicit operator Rect(string text)
107107
}
108108

109109
var parts = text
110-
.Split(new[] { ',' })
110+
.Split(new[] { ',', ' ' })
111111
.SelectToArray(s => double.Parse(s, NumberFormatInfo.InvariantInfo));
112112

113+
if(parts.Length != 4)
114+
{
115+
throw new ArgumentException(
116+
"Cannot create a Rect from " + text + ": needs 4 parts separated by a comma or a space.");
117+
}
118+
113119
return new Rect
114120
(
115121
parts[0],

0 commit comments

Comments
 (0)