13
0

Waveview: properly draw 1px outline

This commit is contained in:
Robin Gareus 2021-11-14 19:13:38 +01:00
parent 3f69e8e329
commit 70a07eec48
Signed by: rgareus
GPG Key ID: A090BCE02CF57F04

View File

@ -614,6 +614,7 @@ WaveView::draw_image (Cairo::RefPtr<Cairo::ImageSurface>& image, PeakData* peaks
wave_context->translate (0.5, 0.5);
outline_context->set_line_width (1.0);
outline_context->set_line_cap (Cairo::LINE_CAP_ROUND);
outline_context->translate (0.5, 0.5);
clip_context->set_line_width (1.0);
@ -672,8 +673,7 @@ WaveView::draw_image (Cairo::RefPtr<Cairo::ImageSurface>& image, PeakData* peaks
clip_context->rel_line_to (0, min (clip_height, ceil(tips[i].spread + .5)));
} else {
outline_context->move_to (i, tips[i].top);
/* normal upper terminal dot */
outline_context->rel_line_to (0, -1.0);
outline_context->line_to (i, tips[i].top);
}
}
@ -740,12 +740,10 @@ WaveView::draw_image (Cairo::RefPtr<Cairo::ImageSurface>& image, PeakData* peaks
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);
outline_context->line_to (i, tips[i].bot);
outline_context->move_to (i, tips[i].top);
/* normal upper terminal dot, line moves down */
outline_context->rel_line_to (0, 1.0);
outline_context->line_to (i, tips[i].top);
}
} else {
bool clipped = false;