]> sigrok.org Git - pulseview.git/commitdiff
Really fix #1125 (and maybe #1139)
authorSoeren Apel <redacted>
Fri, 30 Mar 2018 21:03:28 +0000 (23:03 +0200)
committerSoeren Apel <redacted>
Fri, 30 Mar 2018 21:09:51 +0000 (23:09 +0200)
pv/views/trace/analogsignal.cpp
pv/views/trace/logicsignal.cpp

index 3595840ecfebbf211df9c1cc5d67155329f5a65a..43d1175d3bb466c346dbbf1f1a65657fbd8bf203 100644 (file)
@@ -277,7 +277,7 @@ void AnalogSignal::paint_mid(QPainter &p, ViewItemPaintParams &pp)
                paint_grid(p, y, pp.left(), pp.right());
 
                shared_ptr<pv::data::AnalogSegment> segment = get_analog_segment_to_paint();
-               if (!segment)
+               if (!segment || (segment->get_sample_count() == 0))
                        return;
 
                const double pixels_offset = pp.pixels_offset();
@@ -538,7 +538,7 @@ void AnalogSignal::paint_logic_mid(QPainter &p, ViewItemPaintParams &pp)
        const float low_offset = y + nh - signal_margin - 0.5f;
 
        shared_ptr<pv::data::LogicSegment> segment = get_logic_segment_to_paint();
-       if (!segment)
+       if (!segment || (segment->get_sample_count() == 0))
                return;
 
        double samplerate = segment->samplerate();
index 759f85881c1ed7ba9afb0b6ad1a2b1003063d1df..10a5bd4ae70bb2c1f95503fc8ec2b52c17d4f0d5 100644 (file)
@@ -193,7 +193,7 @@ void LogicSignal::paint_mid(QPainter &p, ViewItemPaintParams &pp)
        const float low_offset = y + 0.5f;
 
        shared_ptr<pv::data::LogicSegment> segment = get_logic_segment_to_paint();
-       if (!segment)
+       if (!segment || (segment->get_sample_count() == 0))
                return;
 
        double samplerate = segment->samplerate();