]> O.S.I.I.S - jp/crow.git/commitdiff
imledit overlay icon
authorJean-Philippe Bruyère <jp_bruyere@hotmail.com>
Wed, 14 Mar 2018 18:20:08 +0000 (19:20 +0100)
committerJean-Philippe Bruyère <jp_bruyere@hotmail.com>
Wed, 14 Mar 2018 18:20:08 +0000 (19:20 +0100)
src/ExtensionsMethods.cs
src/Rectangle.cs

index 231964049762627083976048ffa776a0100cd843..340a8ceb511eabb01fb80179d04e727132259755 100644 (file)
@@ -58,6 +58,9 @@ namespace Crow
                public static Cairo.PointD Substract(this Cairo.PointD p1, Cairo.PointD p2){
                        return new Cairo.PointD(p1.X - p2.X, p1.Y - p2.Y);
                }
+               public static Cairo.PointD Divide(this Cairo.PointD p1, double d){
+                       return new Cairo.PointD(p1.X / d, p1.Y / d);
+               }
                public static Cairo.PointD Add(this Cairo.PointD p1, Cairo.PointD p2){
                        return new Cairo.PointD(p1.X + p2.X, p1.Y + p2.Y);
                }
index 8f48d06d81c9fabc2bcd301760387d55ae51da31..56e4148fb2bf4c6e7e732c3aaa528b81a5478259 100644 (file)
@@ -124,6 +124,14 @@ namespace Crow
                {
                        Inflate (delta, delta);
                }
+               public Rectangle Inflated (int delta) {
+                       return Inflated (delta,delta);
+               }
+               public Rectangle Inflated (int deltaX, int deltaY) {
+                       Rectangle r = this;
+                       r.Inflate (deltaX, deltaY);
+                       return r;
+               }
         public bool ContainsOrIsEqual(Point p)
         {
             return (p.X >= X && p.X <= X + Width && p.Y >= Y && p.Y <= Y + Height) ?