Skip to content

Commit

Permalink
Remove a value check in CLFOGui that messed the display up in some ca…
Browse files Browse the repository at this point in the history
…ses (#3867)

Closes #2258
  • Loading branch information
mkruselj authored Feb 11, 2021
1 parent 24381b0 commit 2d7a4fb
Show file tree
Hide file tree
Showing 2 changed files with 28 additions and 30 deletions.
47 changes: 17 additions & 30 deletions src/common/gui/CLFOGui.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -253,38 +253,36 @@ void CLFOGui::draw(CDrawContext *dc)
// added, remove it from this condition!
edpath->beginSubpath(xc, edval);
if (tFullWave)
{
deactPath->beginSubpath(xc, wval);
}
priorval = val;
}
else
{
if (maxval - minval > 0.2)
{
minval = ((-minval + 1.0f) * 0.5 * 0.8 + 0.1) * valScale;
maxval = ((-maxval + 1.0f) * 0.5 * 0.8 + 0.1) * valScale;
// Windows is sensitive to out-of-order line draws in a way which causes spikes.
// Make sure we draw one closest to prior first. See #1438
float firstval = minval;
float secondval = maxval;
if (priorval - minval < maxval - priorval)
{
firstval = maxval;
secondval = minval;
}
path->addLine(xc - 0.1 * valScale / totalSamples, firstval);
path->addLine(xc + 0.1 * valScale / totalSamples, secondval);
}
else
minval = ((-minval + 1.0f) * 0.5 * 0.8 + 0.1) * valScale;
maxval = ((-maxval + 1.0f) * 0.5 * 0.8 + 0.1) * valScale;
// Windows is sensitive to out-of-order line draws in a way which causes spikes.
// Make sure we draw one closest to prior first. See #1438
float firstval = minval;
float secondval = maxval;
if (priorval - minval < maxval - priorval)
{
path->addLine(xc, val);
firstval = maxval;
secondval = minval;
}
path->addLine(xc - 0.1 * valScale / totalSamples, firstval);
path->addLine(xc + 0.1 * valScale / totalSamples, secondval);

priorval = val;
eupath->addLine(xc, euval);
edpath->addLine(xc, edval);

// We can skip the ordering thing since we know we ahve set rate here to a low rate
// We can skip the ordering thing since we know we have set rate here to a low rate
if (tFullWave)
{
deactPath->addLine(xc, wval);
}
}
}
delete tlfo;
Expand Down Expand Up @@ -637,17 +635,6 @@ void CLFOGui::draw(CDrawContext *dc)
setDirty(false);
}

enum
{
cs_null = 0,
cs_shape,
cs_steps,
cs_trigtray_toggle,
cs_loopstart,
cs_loopend,
cs_linedrag,
};

void CLFOGui::drawStepSeq(VSTGUI::CDrawContext *dc, VSTGUI::CRect &maindisp,
VSTGUI::CRect &leftpanel)
{
Expand Down
11 changes: 11 additions & 0 deletions src/common/gui/CLFOGui.h
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,17 @@ class CLFOGui : public VSTGUI::CControl,
public Surge::UI::SkinConsumingComponent,
public Surge::UI::CursorControlAdapter<CLFOGui>
{
enum control_states
{
cs_null = 0,
cs_shape,
cs_steps,
cs_trigtray_toggle,
cs_loopstart,
cs_loopend,
cs_linedrag,
};

public:
const static int margin = 2;
const static int margin2 = 7;
Expand Down

0 comments on commit 2d7a4fb

Please sign in to comment.