Browse Source

Fix an edge-case if the last stored editor window size is zero

tags/2021-05-28
hogliux 9 years ago
parent
commit
4205123d45
2 changed files with 6 additions and 6 deletions
  1. +2
    -2
      examples/audio plugin demo/Source/PluginProcessor.cpp
  2. +4
    -4
      modules/juce_audio_processors/processors/juce_AudioProcessorEditor.cpp

+ 2
- 2
examples/audio plugin demo/Source/PluginProcessor.cpp View File

@@ -344,8 +344,8 @@ void JuceDemoPluginAudioProcessor::setStateInformation (const void* data, int si
if (xmlState->hasTagName ("MYPLUGINSETTINGS"))
{
// ok, now pull out our last window size..
lastUIWidth = xmlState->getIntAttribute ("uiWidth", lastUIWidth);
lastUIHeight = xmlState->getIntAttribute ("uiHeight", lastUIHeight);
lastUIWidth = jmax (xmlState->getIntAttribute ("uiWidth", lastUIWidth), 400);
lastUIHeight = jmax (xmlState->getIntAttribute ("uiHeight", lastUIHeight), 200);
// Now reload our parameters..
for (int i = 0; i < getNumParameters(); ++i)


+ 4
- 4
modules/juce_audio_processors/processors/juce_AudioProcessorEditor.cpp View File

@@ -65,14 +65,14 @@ void AudioProcessorEditor::setResizable (const bool shouldBeResizable)
else
{
setConstrainer (&defaultConstrainer);
resizableCorner = nullptr;
if (getWidth() > 0 && getHeight() > 0)
{
defaultConstrainer.setSizeLimits (getWidth(), getHeight(), getWidth(), getHeight());
resizableCorner = nullptr;
resized();
}
}
resized();
}
bool AudioProcessorEditor::isResizable() const noexcept


Loading…
Cancel
Save