redraw playhead only if pixel position changed.
[ardour.git] / gtk2_ardour / editor_cursors.cc
index ee8253fed8dee27feb9f9d617ea8a22e77e6c8c8..7cd897604c0f3829949968c90da23f474b9581ea 100644 (file)
@@ -77,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);
        }