summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorPaul Davis <paul@linuxaudiosystems.com>2015-02-11 21:59:25 -0500
committerPaul Davis <paul@linuxaudiosystems.com>2015-02-11 21:59:38 -0500
commit0f0aebf26b5d5a6c30804af9a9665e66489813e3 (patch)
treef987b11200e01fa455234bd51001312f9dff4625
parent11cfdd4c6dcee2eb4c7fae8743576b42ffde246b (diff)
remove naive attempt to avoid drawing first vertical pixel line of Canvas::WaveView
And add commented out attempt at more subtle attempt to get it right
-rw-r--r--libs/canvas/wave_view.cc16
1 files changed, 13 insertions, 3 deletions
diff --git a/libs/canvas/wave_view.cc b/libs/canvas/wave_view.cc
index bae9d3f8f5..b0f86f3e68 100644
--- a/libs/canvas/wave_view.cc
+++ b/libs/canvas/wave_view.cc
@@ -804,8 +804,8 @@ WaveView::render (Rect const & area, Cairo::RefPtr<Cairo::Context> context) cons
* window. We round down in case we were asked to
* draw "between" pixels at the start and/or end.
*/
-
- const double draw_start = floor (draw.x0) + _start_shift;
+
+ double draw_start = floor (draw.x0);
const double draw_end = floor (draw.x1);
// cerr << "Need to draw " << draw_start << " .. " << draw_end << endl;
@@ -824,7 +824,7 @@ WaveView::render (Rect const & area, Cairo::RefPtr<Cairo::Context> context) cons
/* sample coordinates - note, these are not subject to rounding error */
framepos_t sample_start = _region_start + (image_start * _samples_per_pixel);
framepos_t sample_end = _region_start + (image_end * _samples_per_pixel);
-
+
// cerr << "Sample space: " << sample_start << " .. " << sample_end << endl;
Cairo::RefPtr<Cairo::ImageSurface> image;
@@ -834,6 +834,16 @@ WaveView::render (Rect const & area, Cairo::RefPtr<Cairo::Context> context) cons
// cerr << "Offset into image to place at zero: " << image_offset << endl;
+ if (_start_shift && (sample_start == _region_start) && (self.x0 == draw.x0)) {
+ /* we are going to draw the first pixel for this region, but
+ we may not want this to overlap a border around the
+ waveform. If so, _start_shift will be set.
+ */
+ //cerr << name.substr (23) << " ss = " << sample_start << " rs = " << _region_start << " sf = " << _start_shift << " ds = " << draw_start << " self = " << self << " draw = " << draw << endl;
+ //draw_start += _start_shift;
+ //image_offset += _start_shift;
+ }
+
context->rectangle (draw_start, draw.y0, draw_end - draw_start, draw.height());
/* round image origin position to an exact pixel in device space to