Skip to content

Commit

Permalink
Remember zoom inside a session VST3
Browse files Browse the repository at this point in the history
With the change in startup path for the 'no-dance' default
size, the memory of last zoom feature of VST3 got dropped.
This restores it in a more sensible point.

Addresses surge-synthesizer#912
  • Loading branch information
baconpaul committed Jun 16, 2019
1 parent 546f9ea commit 011fc4b
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 0 deletions.
6 changes: 6 additions & 0 deletions src/vst3/SurgeVst3Processor.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -456,6 +456,9 @@ IPlugView* PLUGIN_API SurgeVst3Processor::createView(const char* name)
editor->disableZoom();

editor->setZoomCallback( [this](SurgeGUIEditor *e) { handleZoom(e); } );

if( haveZoomed )
editor->setZoomFactor(lastZoom);

return editor;
}
Expand Down Expand Up @@ -779,5 +782,8 @@ void SurgeVst3Processor::handleZoom(SurgeGUIEditor *e)

frame->setDirty( true );
frame->invalid();

haveZoomed = true;
lastZoom = e->getZoomFactor();
}
}
2 changes: 2 additions & 0 deletions src/vst3/SurgeVst3Processor.h
Original file line number Diff line number Diff line change
Expand Up @@ -138,6 +138,8 @@ class SurgeVst3Processor : public Steinberg::Vst::SingleComponentEffect,
int blockpos;

bool disableZoom;
bool haveZoomed = false;
int lastZoom = -1;
void handleZoom(SurgeGUIEditor *e);

FpuState _fpuState;
Expand Down

0 comments on commit 011fc4b

Please sign in to comment.