Skip to content
Permalink

Comparing changes

Choose two branches to see what’s changed or to start a new pull request. If you need to, you can also or learn more about diff comparisons.

Open a pull request

Create a new pull request by comparing changes across two branches. If you need to, you can also . Learn more about diff comparisons here.
base repository: ngscopeclient/scopehal-apps
Failed to load repositories. Confirm that selected base ref is valid, then try again.
Loading
base: 96a33805ec37
Choose a base ref
...
head repository: ngscopeclient/scopehal-apps
Failed to load repositories. Confirm that selected head ref is valid, then try again.
Loading
compare: bdd9e321389e
Choose a head ref
  • 1 commit
  • 1 file changed
  • 1 contributor

Commits on Sep 6, 2020

  1. Verified

    This commit was signed with the committer’s verified signature.
    lukekarrys Luke Karrys
    Copy the full SHA
    bdd9e32 View commit details
Showing with 17 additions and 1 deletion.
  1. +17 −1 src/glscopeclient/WaveformArea_cairo.cpp
18 changes: 17 additions & 1 deletion src/glscopeclient/WaveformArea_cairo.cpp
Original file line number Diff line number Diff line change
@@ -444,15 +444,29 @@ void WaveformArea::RenderDecodeOverlays(Cairo::RefPtr< Cairo::Context > cr)
if(o.m_channel->GetType() == OscilloscopeChannel::CHANNEL_TYPE_COMPLEX)
{
size_t olen = data->m_offsets.size();

int64_t start_ps = XPositionToXAxisUnits(textright);
int64_t start_samples = start_ps / data->m_timescale;

int64_t end_ps = XPositionToXAxisUnits(m_plotRight);
int64_t end_samples = end_ps / data->m_timescale;

double last_end = textright;
for(size_t i=0; i<olen; i++)
{
if(data->m_offsets[i] < start_samples)
continue;
if(data->m_offsets[i] + data->m_durations[i] > end_samples)
continue;

double start = (data->m_offsets[i] * data->m_timescale) + data->m_triggerPhase;
double end = start + (data->m_durations[i] * data->m_timescale);

double xs = XAxisUnitsToXPosition(start);
double xe = XAxisUnitsToXPosition(end);

if( (xe < textright) || (xs > m_plotRight) )
//If this sample is basically on top of the last one, don't render it.
if( (xe - last_end) < 2)
continue;

auto f = dynamic_cast<Filter*>(o.m_channel);
@@ -463,6 +477,8 @@ void WaveformArea::RenderDecodeOverlays(Cairo::RefPtr< Cairo::Context > cr)
ybot, ymid, ytop,
f->GetText(i),
f->GetColor(i));

last_end = xe;
}
}
}