]> sigrok.org Git - pulseview.git/commitdiff
Oversample edges to prevent gaps
authorJoel Holdsworth <redacted>
Sat, 6 Oct 2012 12:50:16 +0000 (13:50 +0100)
committerJoel Holdsworth <redacted>
Sat, 6 Oct 2012 12:56:26 +0000 (13:56 +0100)
logicsignal.cpp
logicsignal.h

index c42a610fb1c9c30fac8dd73e5b306b0340823570..77ecb2e36416812bb958de8648718337d7f39f82 100644 (file)
@@ -30,6 +30,7 @@ using namespace boost;
 using namespace std;
 
 const float LogicSignal::Margin = 10.0f;
 using namespace std;
 
 const float LogicSignal::Margin = 10.0f;
+const float LogicSignal::Oversampling = 2.0f;
 
 const QColor LogicSignal::EdgeColour(0x80, 0x80, 0x80);
 const QColor LogicSignal::HighColour(0x00, 0xC0, 0x00);
 
 const QColor LogicSignal::EdgeColour(0x80, 0x80, 0x80);
 const QColor LogicSignal::HighColour(0x00, 0xC0, 0x00);
@@ -88,7 +89,7 @@ void LogicSignal::paint(QPainter &p, const QRect &rect, double scale,
        snapshot->get_subsampled_edges(edges,
                min(max((int64_t)floor(start), (int64_t)0), last_sample),
                min(max((int64_t)ceil(end), (int64_t)0), last_sample),
        snapshot->get_subsampled_edges(edges,
                min(max((int64_t)floor(start), (int64_t)0), last_sample),
                min(max((int64_t)ceil(end), (int64_t)0), last_sample),
-               samples_per_pixel, _probe_index);
+               samples_per_pixel / Oversampling, _probe_index);
        assert(edges.size() >= 2);
 
        // Paint the edges
        assert(edges.size() >= 2);
 
        // Paint the edges
index 359162fd7040cedf47410f326f54638d1b9869b3..da9c3a42b749c2cf6473136623c1df9784b71e7c 100644 (file)
@@ -28,6 +28,7 @@ class LogicSignal : public Signal
 {
 private:
        static const float Margin;
 {
 private:
        static const float Margin;
+       static const float Oversampling;
 
        static const QColor EdgeColour;
        static const QColor HighColour;
 
        static const QColor EdgeColour;
        static const QColor HighColour;