Do not show blank waveforms in case height is < 1px

Instead draw some lines to indicate that "something" is there.
This commit is contained in:
Robin Gareus 2020-12-22 13:27:46 +01:00
parent 4b0f72e205
commit 239c340527
Signed by: rgareus
GPG Key ID: A090BCE02CF57F04

View File

@ -1020,7 +1020,17 @@ WaveView::render (Rect const & area, Cairo::RefPtr<Cairo::Context> 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;
}