From 3146fb24af208dbe80506885281302438c4402f8 Mon Sep 17 00:00:00 2001 From: =?utf8?q?Jean-Philippe=20Bruy=C3=A8re?= Date: Wed, 14 Mar 2018 19:20:08 +0100 Subject: [PATCH] imledit overlay icon --- src/ExtensionsMethods.cs | 3 +++ src/Rectangle.cs | 8 ++++++++ 2 files changed, 11 insertions(+) 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) ? -- 2.47.3