summaryrefslogtreecommitdiff
path: root/libs/canvas/item.cc
diff options
context:
space:
mode:
Diffstat (limited to 'libs/canvas/item.cc')
-rw-r--r--libs/canvas/item.cc18
1 files changed, 18 insertions, 0 deletions
diff --git a/libs/canvas/item.cc b/libs/canvas/item.cc
index 534ae6d52e..3c3816881a 100644
--- a/libs/canvas/item.cc
+++ b/libs/canvas/item.cc
@@ -546,6 +546,24 @@ Item::depth () const
return d;
}
+bool
+Item::covers (Duple const & point) const
+{
+ Duple p = canvas_to_item (point);
+
+ if (_bounding_box_dirty) {
+ compute_bounding_box ();
+ }
+
+ boost::optional<Rect> r = bounding_box();
+
+ if (!r) {
+ return false;
+ }
+
+ return r.get().contains (p);
+}
+
ostream&
ArdourCanvas::operator<< (ostream& o, const Item& i)
{