]> sigrok.org Git - pulseview.git/blobdiff - pv/view/logicsignal.cpp
Only show sampling points when zoomed in far enough.
[pulseview.git] / pv / view / logicsignal.cpp
index d4fac8b567d5ee10b9a86626e0eeb77adfe36a7e..251190ece03b789df3c568c99fdba35fe905affa 100644 (file)
@@ -38,6 +38,7 @@
 #include <pv/data/logicsegment.hpp>
 #include <pv/data/signalbase.hpp>
 #include <pv/view/view.hpp>
+#include <pv/globalsettings.hpp>
 
 #include <libsigrokcxx/libsigrokcxx.hpp>
 
@@ -229,6 +230,14 @@ void LogicSignal::paint_mid(QPainter &p, const ViewItemPaintParams &pp)
 
        delete[] cap_lines;
 
+       // Return if we don't need to paint the sampling points
+       GlobalSettings settings;
+       const bool show_sampling_points =
+               settings.value(GlobalSettings::Key_View_ShowSamplingPoints).toBool();
+
+       if (!show_sampling_points || (samples_per_pixel >= 0.25))
+               return;
+
        // Paint the sampling points
        const uint64_t sampling_points_count = end_sample - start_sample + 1;
        QRectF *const sampling_points = new QRectF[sampling_points_count];