From: Soeren Apel Date: Fri, 8 Apr 2016 16:32:41 +0000 (+0200) Subject: DecodeTrace: Make an empty decode trace appear symmetrical X-Git-Url: http://git.code-monkey.de/?a=commitdiff_plain;ds=sidebyside;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 ab9514c..20de375 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)