Permalink
Browse files

Add ToString () and + operator functions.

  • Loading branch information...
jpobst committed Jan 17, 2015
1 parent 446e187 commit e5ef31ffab08462cccf90fc45c00682c8e39c0d6
Showing with 15 additions and 0 deletions.
  1. +10 −0 Pinta.ImageManipulation/Structs/Point.cs
  2. +5 −0 Pinta.ImageManipulation/Structs/Size.cs
@@ -43,5 +43,15 @@ public Point (int x, int y) : this ()
X = x;
Y = y;
}
+
+ public static Point operator + (Point p1, Point p2)
+ {
+ return new Point (p1.X + p2.X, p1.Y + p2.Y);
+ }
+
+ public override string ToString ()
+ {
+ return string.Format ("{{X = {0} Y = {1}}}", X, Y);
+ }
}
}
@@ -54,5 +54,10 @@ public Size (int height, int width) : this ()
{
return !(s1 == s2);
}
+
+ public override string ToString ()
+ {
+ return string.Format ("{{Width = {0} Height = {1}}}", Width, Height);
+ }
}
}

0 comments on commit e5ef31f

Please sign in to comment.