Skip to content

Commit

Permalink
plugin/ide: maintain viewport when saved from IDE
Browse files Browse the repository at this point in the history
  • Loading branch information
JoepVanlier committed Feb 4, 2025
1 parent bceae13 commit 1c4428f
Showing 1 changed file with 5 additions and 2 deletions.
7 changes: 5 additions & 2 deletions plugin/editor.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -450,7 +450,7 @@ void YsfxEditor::Impl::updateInfo()
if (!m_maintainState) switchEditor(true);

juce::File file{juce::CharPointer_UTF8{ysfx_get_file_path(fx)}};
m_mustResizeToGfx = true;
m_mustResizeToGfx = !m_maintainState;

loadScaling();
relayoutUILater();
Expand Down Expand Up @@ -1038,7 +1038,10 @@ void YsfxEditor::Impl::connectUI()
}
};

m_ideView->onFileSaved = [this](const juce::File &file) { loadFile(file, true); };
m_ideView->onFileSaved = [this](const juce::File &file) {
saveScaling();
loadFile(file, true);
};

m_infoTimer.reset(FunctionalTimer::create([this]() { grabInfoAndUpdate(); }));
m_infoTimer->startTimer(100);
Expand Down

0 comments on commit 1c4428f

Please sign in to comment.