From 218ffe2c5f92ed19ec488cda5012b64fcabd5e3f Mon Sep 17 00:00:00 2001 From: Carl Hetherington Date: Fri, 29 Jan 2016 22:57:19 +0000 Subject: Fix indistinct selection of small objects on the timeline. --- src/lib/rect.h | 9 +++++++++ 1 file changed, 9 insertions(+) (limited to 'src/lib') diff --git a/src/lib/rect.h b/src/lib/rect.h index 97b90abc5..5758dd04e 100644 --- a/src/lib/rect.h +++ b/src/lib/rect.h @@ -87,6 +87,15 @@ public: height = std::max (y + height, other.y + other.height) - y; } + Rect extended (T amount) const { + Rect c = *this; + c.x -= amount; + c.y -= amount; + c.width += amount * 2; + c.height += amount * 2; + return c; + } + bool contains (Position p) const { return (p.x >= x && p.x <= (x + width) && p.y >= y && p.y <= (y + height)); -- cgit v1.2.3