diff options
author | Paul Davis <paul@linuxaudiosystems.com> | 2015-02-09 17:55:05 -0500 |
---|---|---|
committer | Paul Davis <paul@linuxaudiosystems.com> | 2015-02-10 19:48:47 -0500 |
commit | 34779ee81ea52abfdb658b320726155c44178483 (patch) | |
tree | 427e3d686ef478ba498b3c5871b61580093d06d1 /libs/canvas/wave_view.cc | |
parent | 99054ea415c8a28227024bc27152fdf30379bdf9 (diff) |
add a sort-of hack to allow us to avoid drawing the first pixel of a waveview when necessary
Diffstat (limited to 'libs/canvas/wave_view.cc')
-rw-r--r-- | libs/canvas/wave_view.cc | 16 |
1 files changed, 15 insertions, 1 deletions
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<ARDOUR::AudioRegion> 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<Cairo::Context> 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 (); +} + |