From 239c340527bdaee84d51d2c61406caa419c07b02 Mon Sep 17 00:00:00 2001 From: Robin Gareus Date: Tue, 22 Dec 2020 13:27:46 +0100 Subject: [PATCH] Do not show blank waveforms in case height is < 1px Instead draw some lines to indicate that "something" is there. --- libs/waveview/wave_view.cc | 12 +++++++++++- 1 file changed, 11 insertions(+), 1 deletion(-) diff --git a/libs/waveview/wave_view.cc b/libs/waveview/wave_view.cc index 3a5c1b4fc0..4de84cbd5a 100644 --- a/libs/waveview/wave_view.cc +++ b/libs/waveview/wave_view.cc @@ -1020,7 +1020,17 @@ WaveView::render (Rect const & area, Cairo::RefPtr context) cons return; } - if (draw.height () < 2) { + if (_props->height < 1) { + if (_props->channel % 2) { + return; + } + context->rectangle (draw.x0, draw.y0, draw.width (), draw.height ()); + if (1 == (_props->channel % 3)) { + set_source_rgba (context, _props->zero_color); + } else { + set_source_rgba (context, _props->fill_color); + } + context->fill (); return; }