Fix indistinct selection of small objects on the timeline.
[dcpomatic.git] / src / lib / rect.h
index 97b90abc5e28546ab74d6c0fa1115460289a0dbb..5758dd04e4496955af9b7cc994c492bf785c40b6 100644 (file)
@@ -87,6 +87,15 @@ public:
                height = std::max (y + height, other.y + other.height) - y;
        }
 
+       Rect<T> extended (T amount) const {
+               Rect<T> c = *this;
+               c.x -= amount;
+               c.y -= amount;
+               c.width += amount * 2;
+               c.height += amount * 2;
+               return c;
+       }
+
        bool contains (Position<T> p) const
        {
                return (p.x >= x && p.x <= (x + width) && p.y >= y && p.y <= (y + height));