From: Joel Holdsworth Date: Sat, 6 Oct 2012 12:50:16 +0000 (+0100) Subject: Oversample edges to prevent gaps X-Git-Tag: pulseview-0.1.0~288 X-Git-Url: https://sigrok.org/gitaction?a=commitdiff_plain;h=17d94d7c698b47df918d195a99c32989c9ef7494;p=pulseview.git Oversample edges to prevent gaps --- diff --git a/logicsignal.cpp b/logicsignal.cpp index c42a610f..77ecb2e3 100644 --- a/logicsignal.cpp +++ b/logicsignal.cpp @@ -30,6 +30,7 @@ using namespace boost; 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); @@ -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), - samples_per_pixel, _probe_index); + samples_per_pixel / Oversampling, _probe_index); assert(edges.size() >= 2); // Paint the edges diff --git a/logicsignal.h b/logicsignal.h index 359162fd..da9c3a42 100644 --- a/logicsignal.h +++ b/logicsignal.h @@ -28,6 +28,7 @@ class LogicSignal : public Signal { private: static const float Margin; + static const float Oversampling; static const QColor EdgeColour; static const QColor HighColour;