diff options
author | Carl Hetherington <carl@carlh.net> | 2011-05-26 17:57:21 +0000 |
---|---|---|
committer | Carl Hetherington <carl@carlh.net> | 2011-05-26 17:57:21 +0000 |
commit | 135e064fbb7f399498616e18c00e13ccd70eb34e (patch) | |
tree | 005146ceed7baa6cd1cf3bf53695a8924996238d /gtk2_ardour/midi_region_view.cc | |
parent | d6be900da002cde17570e742bcc48f1588f73dc9 (diff) |
Flip MIDI region view's verbose canvas cursor to above the mouse pointer if it is near the bottom of the canvas (#3842).
git-svn-id: svn://localhost/ardour2/branches/3.0@9603 d708f5d6-7413-0410-9779-e7cbd77b26cf
Diffstat (limited to 'gtk2_ardour/midi_region_view.cc')
-rw-r--r-- | gtk2_ardour/midi_region_view.cc | 9 |
1 files changed, 9 insertions, 0 deletions
diff --git a/gtk2_ardour/midi_region_view.cc b/gtk2_ardour/midi_region_view.cc index 3f0453e3e1..ca62e2dd05 100644 --- a/gtk2_ardour/midi_region_view.cc +++ b/gtk2_ardour/midi_region_view.cc @@ -3434,6 +3434,15 @@ MidiRegionView::show_verbose_cursor (string const & text, double xoffset, double wx += xoffset; wy += yoffset; + /* Flip the cursor above the mouse pointer if it would overlap the bottom of the canvas */ + + double x1, y1, x2, y2; + trackview.editor().verbose_cursor()->canvas_item()->get_bounds (x1, y1, x2, y2); + + if ((wy + y2 - y1) > trackview.editor().canvas_height()) { + wy -= (y2 - y1) + 2 * yoffset; + } + trackview.editor().verbose_cursor()->set (text, wx, wy); trackview.editor().verbose_cursor()->show (); } |