aboutsummaryrefslogtreecommitdiffstatsci
path: root/src/Point.cs
diff options
context:
space:
mode:
authorjpbruyere <jp.bruyere@hotmail.com>2016-02-02 23:38:54 +0100
committerjpbruyere <jp.bruyere@hotmail.com>2016-02-02 23:38:54 +0100
commit67bd044b6e5fe52b8b76cc5d7eb8fd0ce9dc3ee9 (patch)
treeb94ae5e6ef363eab5f0888b459789ecea9ac5d5d /src/Point.cs
parent2b087282dd73152d21140ea7312a90e046c84f61 (diff)
Gradient, Bitmap and Svg Filling
Diffstat (limited to 'src/Point.cs')
-rw-r--r--src/Point.cs15
1 files changed, 14 insertions, 1 deletions
diff --git a/src/Point.cs b/src/Point.cs
index 369cf01d..76beaa99 100644
--- a/src/Point.cs
+++ b/src/Point.cs
@@ -130,7 +130,7 @@ namespace Crow
public override string ToString()
{
- return string.Format("({0},{1})", X, Y);
+ return string.Format("({0};{1})", X, Y);
}
public override bool Equals(object obj)
@@ -141,6 +141,19 @@ namespace Crow
{
return base.GetHashCode();
}
+ public static Point Parse(string s)
+ {
+ if (string.IsNullOrEmpty (s))
+ return default(Point);
+ string[] d = s.Trim().Split(';');
+ if (d.Length == 2)
+ return new Point (int.Parse (d [0]), int.Parse (d [1]));
+ else if (d.Length == 1) {
+ int tmp = int.Parse (d [0]);
+ return new Point (tmp, tmp);
+ }
+ throw new Exception ("Crow.Point Parsing Error: " + s);
+ }
}
}