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 (); } diff --git a/gtk2_ardour/public_editor.h b/gtk2_ardour/public_editor.h index b5db8377d3..84194f2b35 100644 --- a/gtk2_ardour/public_editor.h +++ b/gtk2_ardour/public_editor.h @@ -258,6 +258,7 @@ class PublicEditor : public Gtk::Window, public PBD::StatefulDestructible { virtual void show_window () = 0; virtual framepos_t leftmost_position() const = 0; virtual framecnt_t current_page_frames() const = 0; + virtual double canvas_height () const = 0; virtual void temporal_zoom_step (bool coarser) = 0; virtual void scroll_tracks_down_line () = 0; virtual void scroll_tracks_up_line () = 0;