diff options
author | Paul Davis <paul@linuxaudiosystems.com> | 2013-04-11 20:01:14 -0400 |
---|---|---|
committer | Paul Davis <paul@linuxaudiosystems.com> | 2013-04-11 20:01:14 -0400 |
commit | 1fda7b293ac3435526e3992a37b19f9ada19a3bd (patch) | |
tree | e17dea24ddf6941f56ef75e918f52efdde5a9f74 /gtk2_ardour/midi_region_view.cc | |
parent | ae2b39b2e346548e2bf9f6cb308d8bd0b9d64005 (diff) |
fix up positioning of verbose cursor if it is too close to the bottom of the canvas (for MidiRegionView)
Diffstat (limited to 'gtk2_ardour/midi_region_view.cc')
-rw-r--r-- | gtk2_ardour/midi_region_view.cc | 9 |
1 files changed, 7 insertions, 2 deletions
diff --git a/gtk2_ardour/midi_region_view.cc b/gtk2_ardour/midi_region_view.cc index ed1708a7a9..acc6aafdeb 100644 --- a/gtk2_ardour/midi_region_view.cc +++ b/gtk2_ardour/midi_region_view.cc @@ -3820,6 +3820,7 @@ MidiRegionView::show_verbose_cursor (string const & text, double xoffset, double { double wx, wy; + trackview.editor().verbose_cursor()->set_text (text); trackview.editor().get_pointer_position (wx, wy); wx += xoffset; @@ -3827,13 +3828,17 @@ MidiRegionView::show_verbose_cursor (string const & text, double xoffset, double /* Flip the cursor above the mouse pointer if it would overlap the bottom of the canvas */ - ArdourCanvas::Rect bb = trackview.editor().verbose_cursor()->item().bounding_box().get(); + boost::optional<ArdourCanvas::Rect> bbo = trackview.editor().verbose_cursor()->item().bounding_box(); + + assert (bbo); + + ArdourCanvas::Rect bb = bbo.get(); if ((wy + bb.y1 - bb.y0) > trackview.editor().visible_canvas_height()) { wy -= (bb.y1 - bb.y0) + 2 * yoffset; } - trackview.editor().verbose_cursor()->set (text, wx, wy); + trackview.editor().verbose_cursor()->set_position (wx, wy); trackview.editor().verbose_cursor()->show (); } |