From: Soeren Apel Date: Fri, 8 Apr 2016 16:32:41 +0000 (+0200) Subject: DecodeTrace: Make an empty decode trace appear symmetrical X-Git-Tag: pulseview-0.4.0~311 X-Git-Url: https://sigrok.org/gitaction?a=commitdiff_plain;h=e40a79cb13eef1ca4f8e7670ac4a36e56b26a23c;p=pulseview.git DecodeTrace: Make an empty decode trace appear symmetrical --- diff --git a/pv/view/decodetrace.cpp b/pv/view/decodetrace.cpp index ab9514cd..20de3755 100644 --- a/pv/view/decodetrace.cpp +++ b/pv/view/decodetrace.cpp @@ -169,7 +169,10 @@ pair DecodeTrace::v_extents() const { const int row_height = (ViewItemPaintParams::text_height() * 6) / 4; - return make_pair(-row_height, row_height * max_visible_rows_); + // Make an empty decode trace appear symmetrical + const int row_count = max(1, max_visible_rows_); + + return make_pair(-row_height, row_height * row_count); } void DecodeTrace::paint_back(QPainter &p, const ViewItemPaintParams &pp)