]> sigrok.org Git - pulseview.git/blobdiff - pv/view/decodetrace.cpp
DecodeTrace: Let the view know when we need more space
[pulseview.git] / pv / view / decodetrace.cpp
index 20de3755be482688be6cc2ce4f28220c2bd84f5c..c2369e866fbe3b7286c602adc41735ed1c6a579b 100644 (file)
@@ -198,6 +198,9 @@ void DecodeTrace::paint_mid(QPainter &p, const ViewItemPaintParams &pp)
                return;
        }
 
+       // Set default pen to allow for text width calculation
+       p.setPen(Qt::black);
+
        // Iterate through the rows
        int y = get_visual_y();
        pair<uint64_t, uint64_t> sample_range = get_sample_range(
@@ -242,6 +245,9 @@ void DecodeTrace::paint_mid(QPainter &p, const ViewItemPaintParams &pp)
        // Draw the hatching
        draw_unresolved_period(p, annotation_height, pp.left(), pp.right());
 
+       if ((int)visible_rows_.size() > max_visible_rows_)
+               owner_->extents_changed(false, true);
+
        // Update the maximum row count if needed
        max_visible_rows_ = std::max(max_visible_rows_, (int)visible_rows_.size());
 }