X-Git-Url: https://sigrok.org/gitweb/?p=pulseview.git;a=blobdiff_plain;f=pv%2Fview%2Flogicsignal.cpp;h=d529cabfb80eab75edcb8ccce37d1b5033dd2f1a;hp=49d1263642b9b97ee3bac15c95fbe8a897e2f724;hb=bf9146988d2298e1750142dccdcf597ef13d6606;hpb=4c60462b00cc329e61daedd1c2e66724077bd412 diff --git a/pv/view/logicsignal.cpp b/pv/view/logicsignal.cpp index 49d12636..d529cabf 100644 --- a/pv/view/logicsignal.cpp +++ b/pv/view/logicsignal.cpp @@ -189,15 +189,18 @@ void LogicSignal::paint_mid(QPainter &p, const ViewItemPaintParams &pp) samplerate = 1.0; const double pixels_offset = pp.pixels_offset(); - const double start_time = segment->start_time(); + const pv::util::Timestamp& start_time = segment->start_time(); const int64_t last_sample = segment->get_sample_count() - 1; const double samples_per_pixel = samplerate * pp.scale(); - const double start = samplerate * (pp.offset() - start_time); - const double end = start + samples_per_pixel * pp.width(); + const pv::util::Timestamp start = samplerate * (pp.offset() - start_time); + const pv::util::Timestamp end = start + samples_per_pixel * pp.width(); - segment->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), + const int64_t start_sample = min(max(floor(start).convert_to(), + (int64_t)0), last_sample); + const uint64_t end_sample = min(max(ceil(end).convert_to(), + (int64_t)0), last_sample); + + segment->get_subsampled_edges(edges, start_sample, end_sample, samples_per_pixel / Oversampling, channel_->index()); assert(edges.size() >= 2); @@ -417,7 +420,7 @@ void LogicSignal::modify_trigger() if (trigger) { for (auto stage : trigger->stages()) { const auto &matches = stage->matches(); - if (std::none_of(begin(matches), end(matches), + if (std::none_of(matches.begin(), matches.end(), [&](shared_ptr match) { return match->channel() != channel_; })) continue;