Fix mouse event position offset bug.
authorDavid Robillard <d@drobilla.net>
Mon, 12 Jan 2015 05:57:10 +0000 (00:57 -0500)
committerDavid Robillard <d@drobilla.net>
Mon, 12 Jan 2015 06:05:01 +0000 (01:05 -0500)
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.

libs/canvas/canvas.cc

index eb18899ab3b446bc44f8df51ae680dcec3873e0f..3ac91deda863b3d835a7259f4654421e2bac5c7c 100644 (file)
@@ -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;
                }