mirror of
https://github.com/Ardour/ardour.git
synced 2026-01-03 12:19:33 +01:00
in Canvas::window_to_canvas(), if either x or y coordinate is less than zero, search for the scroll group on the relevant edge.
If we don't do this then we find no scroll group covering the event coordinate, and the translation for scroll fails to be applied
This commit is contained in:
parent
1983bae513
commit
f22f5725d5
1 changed files with 14 additions and 1 deletions
|
|
@ -231,8 +231,21 @@ Canvas::window_to_canvas (Duple const & d) const
|
|||
std::list<Item*> const& root_children (_root.items());
|
||||
ScrollGroup* sg = 0;
|
||||
|
||||
/* if the coordinates are negative, clamp to zero and find the item
|
||||
* that covers that "edge" position.
|
||||
*/
|
||||
|
||||
Duple in_window (d);
|
||||
|
||||
if (in_window.x < 0) {
|
||||
in_window.x = 0;
|
||||
}
|
||||
if (in_window.y < 0) {
|
||||
in_window.y = 0;
|
||||
}
|
||||
|
||||
for (std::list<Item*>::const_iterator i = root_children.begin(); i != root_children.end(); ++i) {
|
||||
if (((sg = dynamic_cast<ScrollGroup*>(*i)) != 0) && sg->covers_window (d)) {
|
||||
if (((sg = dynamic_cast<ScrollGroup*>(*i)) != 0) && sg->covers_window (in_window)) {
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue