Skip to content

Commit

Permalink
Fix a drag-to-zoom recursion (#5089)
Browse files Browse the repository at this point in the history
Drag to zoom back on; that recursion freak out fixed.

Closes #5025
  • Loading branch information
baconpaul authored Sep 14, 2021
1 parent bf27ad6 commit 57092c7
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 2 deletions.
6 changes: 4 additions & 2 deletions src/surge_synth_juce/SurgeSynthEditor.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -191,9 +191,11 @@ void SurgeSynthEditor::resized()
tempoTypein->setVisible(false);
}

if (zfn != 1.0)
if (zfn != 1.0 && rezoomGuard == 0)
{
// adapter->setZoomFactor(adapter->getZoomFactor() * zfn, false);
rezoomGuard++;
adapter->setZoomFactor(adapter->getZoomFactor() * zfn, false);
rezoomGuard--;
}
}

Expand Down
1 change: 1 addition & 0 deletions src/surge_synth_juce/SurgeSynthEditor.h
Original file line number Diff line number Diff line change
Expand Up @@ -35,6 +35,7 @@ class SurgeSynthEditor : public juce::AudioProcessorEditor,
//==============================================================================
void paint(juce::Graphics &) override;
void resized() override;
int rezoomGuard{0};
void parentHierarchyChanged() override;

void paramsChangedCallback();
Expand Down

0 comments on commit 57092c7

Please sign in to comment.