X-Git-Url: https://git.carlh.net/gitweb/?a=blobdiff_plain;f=gtk2_ardour%2Feditor_cursors.cc;h=3df7761007a09c46da17b799932c64c2403d58e8;hb=d314a510f67c2b072f856914d2a94b9748fb7e4e;hp=de89274fcc9f7c4372dcb0d9d161e6e75538cc0b;hpb=601c317d70a03190257577bd867cefc2c70d3275;p=ardour.git diff --git a/gtk2_ardour/editor_cursors.cc b/gtk2_ardour/editor_cursors.cc index de89274fcc..3df7761007 100644 --- a/gtk2_ardour/editor_cursors.cc +++ b/gtk2_ardour/editor_cursors.cc @@ -50,7 +50,7 @@ EditorCursor::EditorCursor (Editor& ed, bool (Editor::*callbck)(GdkEvent*,Ardour _track_canvas_item->set_x (0); - _current_frame = 1; /* force redraw at 0 */ + _current_sample = 1; /* force redraw at 0 */ } EditorCursor::EditorCursor (Editor& ed) @@ -66,7 +66,7 @@ EditorCursor::EditorCursor (Editor& ed) _track_canvas_item->set_x (0); - _current_frame = 1; /* force redraw at 0 */ + _current_sample = 1; /* force redraw at 0 */ } EditorCursor::~EditorCursor () @@ -75,17 +75,17 @@ EditorCursor::~EditorCursor () } void -EditorCursor::set_position (framepos_t frame) +EditorCursor::set_position (samplepos_t sample) { - if (_current_frame != frame) { PositionChanged (frame); } + if (_current_sample != sample) { PositionChanged (sample); } - double const new_pos = _editor.sample_to_pixel_unrounded (frame); + double const new_pos = _editor.sample_to_pixel_unrounded (sample); if (rint(new_pos) != rint(_track_canvas_item->x ())) { - _track_canvas_item->set_x (new_pos); + _track_canvas_item->set_x (new_pos-0.5); //accommodate the 1/2 pixel "line" offset in cairo } - _current_frame = frame; + _current_sample = sample; } void