diff options
author | Paul Davis <paul@linuxaudiosystems.com> | 2015-06-23 17:12:52 -0400 |
---|---|---|
committer | Paul Davis <paul@linuxaudiosystems.com> | 2015-06-23 17:12:52 -0400 |
commit | 2b81d4d0feb06a18d31463ab884de5e56722a346 (patch) | |
tree | 722c7fdf03576a7e9397902c29fafbd471b98358 | |
parent | e9224a58d187a8fc403ffff904648d28f5045d69 (diff) |
do not draw waveform outline at x-positions where the waveform "spread" would not leave at least 1 pixel between the two outline pixels.
Plus a better comment.
-rw-r--r-- | libs/canvas/wave_view.cc | 17 |
1 files changed, 13 insertions, 4 deletions
diff --git a/libs/canvas/wave_view.cc b/libs/canvas/wave_view.cc index 7b00b0eae7..1a969d60e3 100644 --- a/libs/canvas/wave_view.cc +++ b/libs/canvas/wave_view.cc @@ -625,7 +625,11 @@ WaveView::draw_image (Cairo::RefPtr<Cairo::ImageSurface>& image, PeakData* _peak clipped = true; } - if (!clipped) { + if (!clipped && tips[i].spread > 2.0) { + /* only draw the outline if the spread + implies 3 or more pixels (so that we see 1 + white pixel in the middle). + */ outline_context->move_to (i, tips[i].bot); /* normal lower terminal dot; line moves up */ outline_context->rel_line_to (0, -1.0); @@ -645,10 +649,15 @@ WaveView::draw_image (Cairo::RefPtr<Cairo::ImageSurface>& image, PeakData* _peak } if (!clipped) { + /* special case where only 1 pixel of + * the waveform line is drawn (and + * nothing else). + * + * we draw a 1px "line", pretending + * that the span is 1.0 (whether it is + * zero or 1.0) + */ wave_context->move_to (i, tips[i].top); - /* special case where outline only is drawn. - * we draw a 1px "line", pretending that the span is 1.0 - */ wave_context->rel_line_to (0, 1.0); } } |