X-Git-Url: https://main.carlh.net/gitweb/?a=blobdiff_plain;f=libs%2Fcanvas%2Fwave_view.cc;h=bae9d3f8f510f33080b612da5fdb6c243f1cb728;hb=2a5921ecf159d49597264a9328dc899bba55e57e;hp=9c4ae778fed58d57944da5e794cc11c676ededa5;hpb=f28288409466cb64eb741bded1d77e75c1533da1;p=ardour.git diff --git a/libs/canvas/wave_view.cc b/libs/canvas/wave_view.cc index 9c4ae778fe..bae9d3f8f5 100644 --- a/libs/canvas/wave_view.cc +++ b/libs/canvas/wave_view.cc @@ -71,6 +71,7 @@ WaveView::WaveView (Canvas* c, boost::shared_ptr region) , _gradient_depth_independent (false) , _amplitude_above_axis (1.0) , _region_amplitude (_region->scale_amplitude ()) + , _start_shift (0.0) , _region_start (region->start()) { VisualPropertiesChanged.connect_same_thread (invalidation_connection, boost::bind (&WaveView::handle_visual_property_change, this)); @@ -804,7 +805,7 @@ WaveView::render (Rect const & area, Cairo::RefPtr context) cons * draw "between" pixels at the start and/or end. */ - const double draw_start = floor (draw.x0); + const double draw_start = floor (draw.x0) + _start_shift; const double draw_end = floor (draw.x1); // cerr << "Need to draw " << draw_start << " .. " << draw_end << endl; @@ -1034,3 +1035,16 @@ WaveView::set_global_show_waveform_clipping (bool yn) ClipLevelChanged (); } } + +void +WaveView::set_start_shift (double pixels) +{ + if (pixels < 0) { + return; + } + + begin_visual_change (); + _start_shift = pixels; + end_visual_change (); +} +