Skip to content

Commit

Permalink
Lfo display cache fix (surge-synthesizer#7947)
Browse files Browse the repository at this point in the history
Clear display cache on
* skin change
* rate activate/deactivate
* deform type change
* tempo sync activate/deactivate
  • Loading branch information
blancoberg authored Jan 3, 2025
1 parent e612bfc commit 8f6c469
Show file tree
Hide file tree
Showing 2 changed files with 20 additions and 0 deletions.
19 changes: 19 additions & 0 deletions src/surge-xt/gui/widgets/LFOAndStepDisplay.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -463,6 +463,24 @@ bool LFOAndStepDisplay::paramsHasChanged()
++p;
};

if (lfodata->rate.deactivated != settingsFromLastDrawCall[0].b)
{
settingsFromLastDrawCall[0].b = lfodata->rate.deactivated;
hasChanged = true;
}

if (lfodata->deform.deform_type != paramsFromLastDrawCall[1].i)
{
paramsFromLastDrawCall[1].i = lfodata->deform.deform_type;
hasChanged = true;
}

if (lfodata->rate.temposync != paramsFromLastDrawCall[2].b)
{
paramsFromLastDrawCall[2].b = lfodata->rate.temposync;
hasChanged = true;
}

if (lfoStorageFromLastDrawingCall != lfodata)
hasChanged = true;

Expand Down Expand Up @@ -1728,6 +1746,7 @@ void LFOAndStepDisplay::onSkinChanged()
{
return;
}
forceRepaint = true;
auto typesWithHover = skin->standardHoverAndHoverOnForIDB(IDB_LFO_TYPE, associatedBitmapStore);
typeImg = typesWithHover[0];
typeImgHover = typesWithHover[1];
Expand Down
1 change: 1 addition & 0 deletions src/surge-xt/gui/widgets/LFOAndStepDisplay.h
Original file line number Diff line number Diff line change
Expand Up @@ -63,6 +63,7 @@ struct LFOAndStepDisplay : public juce::Component,
bool forceRepaint;
LFOStorage *lfoStorageFromLastDrawingCall;
pdata paramsFromLastDrawCall[n_scene_params];
pdata settingsFromLastDrawCall[8];
int zoomFactorFromLastDrawCall;

bool paramsHasChanged();
Expand Down

0 comments on commit 8f6c469

Please sign in to comment.