]> sigrok.org Git - pulseview.git/blobdiff - pv/views/trace/analogsignal.cpp
Fix for "fill logic signal high areas" feature
[pulseview.git] / pv / views / trace / analogsignal.cpp
index 5b3241d2d35beb1aa4a552743aff00705d5319ac..2643c643fe9ca919028b5c82a44dbfa70a576d22 100644 (file)
@@ -614,10 +614,11 @@ void AnalogSignal::paint_logic_mid(QPainter &p, ViewItemPaintParams &pp)
 
                if (fill_high_areas) {
                        // Any edge terminates a high area
-                       const int width = x - rising_edge_x;
-                       if (rising_edge_seen && (width > 0)) {
-                               high_rects.emplace_back(rising_edge_x, high_offset,
-                                       width, signal_height);
+                       if (rising_edge_seen) {
+                               const int width = x - rising_edge_x;
+                               if (width > 0)
+                                       high_rects.emplace_back(rising_edge_x, high_offset,
+                                               width, signal_height);
                                rising_edge_seen = false;
                        }