From f98f624fd77c1520e31f8573e828b9b97ecc27c5 Mon Sep 17 00:00:00 2001 From: Ingo Ruhnke Date: Mon, 25 Aug 2014 05:37:53 +0200 Subject: [PATCH] Added Rectf::grown(float border) method --- src/math/rectf.hpp | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/src/math/rectf.hpp b/src/math/rectf.hpp index 80bc47829bd..cdff094b496 100644 --- a/src/math/rectf.hpp +++ b/src/math/rectf.hpp @@ -129,6 +129,12 @@ class Rectf return ((v1 - v2).norm ()); } + Rectf grown(float border) const + { + return Rectf(p1.x - border, p1.y - border, + p2.x + border, p2.y + border); + } + // leave these two public to save the headaches of set/get functions for such // simple things :)