From: Jean-Philippe Bruyère Date: Wed, 14 Mar 2018 18:20:08 +0000 (+0100) Subject: imledit overlay icon X-Git-Tag: v0.9.5-beta~153^2~6 X-Git-Url: https://git.osiis.dedyn.io/?a=commitdiff_plain;h=3146fb24af208dbe80506885281302438c4402f8;p=jp%2Fcrow.git imledit overlay icon --- diff --git a/src/ExtensionsMethods.cs b/src/ExtensionsMethods.cs index 23196404..340a8ceb 100644 --- a/src/ExtensionsMethods.cs +++ b/src/ExtensionsMethods.cs @@ -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); } diff --git a/src/Rectangle.cs b/src/Rectangle.cs index 8f48d06d..56e4148f 100644 --- a/src/Rectangle.cs +++ b/src/Rectangle.cs @@ -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) ?