X-Git-Url: https://main.carlh.net/gitweb/?a=blobdiff_plain;ds=sidebyside;f=gtk2_ardour%2Feditor_cursors.cc;h=40245778d5b950dfc270f540c7484c79ddf8de06;hb=a5ae129a066747901ff1ed95368729b63cb6a70d;hp=e0af33575bde3c60d4f6cdf7e23bd152f84edef5;hpb=16947f751b9615c3b7a6be710db15bc66c45bc5d;p=ardour.git diff --git a/gtk2_ardour/editor_cursors.cc b/gtk2_ardour/editor_cursors.cc index e0af33575b..40245778d5 100644 --- a/gtk2_ardour/editor_cursors.cc +++ b/gtk2_ardour/editor_cursors.cc @@ -33,7 +33,7 @@ using namespace Gtk; EditorCursor::EditorCursor (Editor& ed, bool (Editor::*callbck)(GdkEvent*,ArdourCanvas::Item*)) : _editor (ed) - , _track_canvas_item (new ArdourCanvas::Arrow (_editor.get_hscroll_group())) + , _track_canvas_item (new ArdourCanvas::Arrow (_editor.get_cursor_scroll_group())) { CANVAS_DEBUG_NAME (_track_canvas_item, "track canvas editor cursor"); @@ -47,7 +47,9 @@ EditorCursor::EditorCursor (Editor& ed, bool (Editor::*callbck)(GdkEvent*,Ardour _track_canvas_item->Event.connect (sigc::bind (sigc::mem_fun (ed, callbck), _track_canvas_item)); _track_canvas_item->set_y1 (ArdourCanvas::COORD_MAX); - + + _track_canvas_item->set_x (0); + _current_frame = 1; /* force redraw at 0 */ } @@ -61,7 +63,9 @@ EditorCursor::EditorCursor (Editor& ed) _track_canvas_item->set_show_head (1, false); _track_canvas_item->set_y1 (ArdourCanvas::COORD_MAX); _track_canvas_item->set_ignore_events (true); - + + _track_canvas_item->set_x (0); + _current_frame = 1; /* force redraw at 0 */ } @@ -73,11 +77,11 @@ EditorCursor::~EditorCursor () void EditorCursor::set_position (framepos_t frame) { - PositionChanged (frame); + if (_current_frame != frame) { PositionChanged (frame); } double const new_pos = _editor.sample_to_pixel_unrounded (frame); - if (new_pos != _track_canvas_item->x ()) { + if (rint(new_pos) != rint(_track_canvas_item->x ())) { _track_canvas_item->set_x (new_pos); }