X-Git-Url: https://sigrok.org/gitweb/?p=pulseview.git;a=blobdiff_plain;f=pv%2Flogicsignal.cpp;h=a0dabe4a00ed1c39bf1d68c51a950238afc448f4;hp=fe5572d232d8184ebb25807c0bdc4b9755022232;hb=ce6e73a8e2a2a353233b440f4bbbd53007602e1a;hpb=cef18fc6160f8f5055f2617fbe06eb082c2a7bd5 diff --git a/pv/logicsignal.cpp b/pv/logicsignal.cpp index fe5572d2..a0dabe4a 100644 --- a/pv/logicsignal.cpp +++ b/pv/logicsignal.cpp @@ -54,8 +54,8 @@ const QColor LogicSignal::LogicSignalColours[10] = { LogicSignal::LogicSignal(QString name, shared_ptr data, int probe_index) : Signal(name), - _data(data), - _probe_index(probe_index) + _probe_index(probe_index), + _data(data) { assert(_probe_index >= 0); } @@ -70,8 +70,8 @@ void LogicSignal::paint(QPainter &p, const QRect &rect, double scale, assert(scale > 0); assert(_data); - const float high_offset = rect.top() + Margin; - const float low_offset = rect.bottom() - Margin; + const float high_offset = rect.top() + Margin + 0.5f; + const float low_offset = rect.bottom() - Margin + 0.5f; const deque< shared_ptr > &snapshots = _data->get_snapshots(); @@ -102,7 +102,7 @@ void LogicSignal::paint(QPainter &p, const QRect &rect, double scale, for(vector::const_iterator i = edges.begin() + 1; i != edges.end() - 1; i++) { - const int x = (int)((*i).first / samples_per_pixel - + const float x = ((*i).first / samples_per_pixel - pixels_offset) + rect.left(); *line++ = QLineF(x, high_offset, x, low_offset); } @@ -125,10 +125,10 @@ void LogicSignal::paint(QPainter &p, const QRect &rect, double scale, delete[] cap_lines; } -int LogicSignal::paint_caps(QPainter &p, QLineF *const lines, +void LogicSignal::paint_caps(QPainter &p, QLineF *const lines, vector< pair > &edges, bool level, - double samples_per_pixel, double pixels_offset, int x_offset, - int y_offset) + double samples_per_pixel, double pixels_offset, float x_offset, + float y_offset) { QLineF *line = lines; @@ -136,9 +136,9 @@ int LogicSignal::paint_caps(QPainter &p, QLineF *const lines, i != (edges.end() - 1); i++) if((*i).second == level) { *line++ = QLineF( - (int)((*i).first / samples_per_pixel - + ((*i).first / samples_per_pixel - pixels_offset) + x_offset, y_offset, - (int)((*(i+1)).first / samples_per_pixel - + ((*(i+1)).first / samples_per_pixel - pixels_offset) + x_offset, y_offset); }