summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDavid Robillard <d@drobilla.net>2015-01-12 00:57:10 -0500
committerDavid Robillard <d@drobilla.net>2015-01-12 01:05:01 -0500
commit55278fb3b087c7aed33235c0619fe710fcd3b154 (patch)
tree492e40c71e8273579bd8071480d38ce2b141df8c
parente79af77a18c13a304c0c08e52ca337b03ecc0a78 (diff)
Fix mouse event position offset bug.
Search scroll groups for event delivery from top to bottom rather than bottom to top. Overlapping scroll groups still aren't properly supported by the canvas, but currently all we care about is that the top one gets the event, so the hscroll group (tempo lines) can be below the hvscroll group (tracks), but the latter gets events.
-rw-r--r--libs/canvas/canvas.cc2
1 files changed, 1 insertions, 1 deletions
diff --git a/libs/canvas/canvas.cc b/libs/canvas/canvas.cc
index eb18899ab3..3ac91deda8 100644
--- a/libs/canvas/canvas.cc
+++ b/libs/canvas/canvas.cc
@@ -251,7 +251,7 @@ Canvas::window_to_canvas (Duple const & d) const
in_window.y = 0;
}
- for (std::list<Item*>::const_iterator i = root_children.begin(); i != root_children.end(); ++i) {
+ for (std::list<Item*>::const_reverse_iterator i = root_children.rbegin(); i != root_children.rend(); ++i) {
if (((sg = dynamic_cast<ScrollGroup*>(*i)) != 0) && sg->covers_window (in_window)) {
break;
}