mirror of
https://github.com/Ardour/ardour.git
synced 2026-01-08 22:55:44 +01:00
ScrollGroup::covers_{window,canvas}() need to account for possible non-zero position of the group.
They also do NOT need to consider scroll offset
This commit is contained in:
parent
7356ff6ab5
commit
05a5bcc84c
1 changed files with 13 additions and 5 deletions
|
|
@ -81,13 +81,18 @@ ScrollGroup::scroll_to (Duple const& d)
|
|||
bool
|
||||
ScrollGroup::covers_canvas (Duple const& d) const
|
||||
{
|
||||
boost::optional<Rect> r = bounding_box ();
|
||||
boost::optional<Rect> r = bounding_box ();
|
||||
|
||||
if (!r) {
|
||||
return false;
|
||||
}
|
||||
|
||||
return r->contains (d);
|
||||
/* Bounding box is in item coordinates, but we need
|
||||
to consider the position of the bounding box
|
||||
within the canvas.
|
||||
*/
|
||||
|
||||
return r->translate (position()).contains (d);
|
||||
}
|
||||
|
||||
bool
|
||||
|
|
@ -99,7 +104,10 @@ ScrollGroup::covers_window (Duple const& d) const
|
|||
return false;
|
||||
}
|
||||
|
||||
Rect w = r->translate (-_scroll_offset);
|
||||
|
||||
return w.contains (d);
|
||||
/* Bounding box is in item coordinates, but we need
|
||||
to consider the position of the bounding box
|
||||
within the canvas.
|
||||
*/
|
||||
|
||||
return r->translate (position()).contains (d);
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue