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: 27f71ad05f18
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: 5273d88ff62a
Choose a head ref
  • 1 commit
  • 1 file changed
  • 1 contributor

Commits on Apr 17, 2021

  1. Verified

    This commit was created on GitHub.com and signed with GitHub’s verified signature. The key has expired.
    Copy the full SHA
    5273d88 View commit details
Showing with 14 additions and 3 deletions.
  1. +14 −3 src/glscopeclient/WaveformArea_cairo.cpp
17 changes: 14 additions & 3 deletions src/glscopeclient/WaveformArea_cairo.cpp
Original file line number Diff line number Diff line change
@@ -979,6 +979,13 @@ void WaveformArea::RenderComplexSignal(
//Width within this signal outline
float available_width = xend - xstart - 2*xoff;

//Convert all whitespace in text to spaces
for(size_t i=0; i<str.length(); i++)
{
if(isspace(str[i]))
str[i] = ' ';
}

//If the space is tiny, don't even attempt to render it.
//Figuring out text size is expensive when we have hundreds or thousands of packets on screen, but in this case
//we *know* it won't fit.
@@ -1007,11 +1014,12 @@ void WaveformArea::RenderComplexSignal(
xp -= width/2;

//Off the left end? Push it right
float new_width = available_width;
int padding = 5;
if(xp < (visleft + padding))
{
xp = visleft + padding;
available_width = xend - xp - xoff;
new_width = xend - xp - xoff;
}

//Off the right end? Push it left
@@ -1022,11 +1030,14 @@ void WaveformArea::RenderComplexSignal(
xp = xstart + xoff;

if(xend < visright)
available_width = xend - xp - xoff;
new_width = xend - xp - xoff;
else
available_width = visright - xp - xoff;
new_width = visright - xp - xoff;
}

if(new_width < available_width)
available_width = new_width;

//If we don't fit under the new constraints, give up
if(available_width < min_width)
str = "";