Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Remember zoom inside a session VST3 #913

Merged
merged 1 commit into from
Jun 16, 2019
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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