Put playhead on top of everything.

Achieve this by adding a new hscroll group just for cursors.

That requires a slightly smarter window_to_canvas() to deal with overlapping
sensitive scroll groups.  New rule is that scroll groups can overlap, but the
most sensitive one found from the top down will be chosen to translate
coordinates.  This basically means don't overlap scroll groups with different
sensitivities.

In the presence of scroll groups, having a canvas-wide window_to_canvas()
and/or canvas_to_window() fundamentally makes no sense.  At some point in the
glorious future we should kill those and use only item-relative coordinate
translation.
This commit is contained in:
David Robillard 2015-01-16 19:09:47 -05:00
parent d194ec9135
commit b759fd5879
6 changed files with 26 additions and 6 deletions

View file

@ -80,6 +80,7 @@ Editor::initialize_canvas ()
ArdourCanvas::ScrollGroup* hsg;
ArdourCanvas::ScrollGroup* hg;
ArdourCanvas::ScrollGroup* cg;
h_scroll_group = hg = new ArdourCanvas::ScrollGroup (_track_canvas->root(), ArdourCanvas::ScrollGroup::ScrollsHorizontally);
CANVAS_DEBUG_NAME (h_scroll_group, "canvas h scroll");
@ -91,6 +92,10 @@ Editor::initialize_canvas ()
CANVAS_DEBUG_NAME (hv_scroll_group, "canvas hv scroll");
_track_canvas->add_scroller (*hsg);
cursor_scroll_group = cg = new ArdourCanvas::ScrollGroup (_track_canvas->root(), ArdourCanvas::ScrollGroup::ScrollsHorizontally);
CANVAS_DEBUG_NAME (cursor_scroll_group, "canvas cursor scroll");
_track_canvas->add_scroller (*cg);
_verbose_cursor = new VerboseCursor (this);
/* on the bottom, an image */