Browse Source

AudioProcessorEditor: Set ComponentBoundsConstrainer stretchingTop/Left/Bottom/Right values when calling setBoundsForComponent()

tags/2021-05-28
ed 4 years ago
parent
commit
ad8f2013b5
1 changed files with 13 additions and 3 deletions
  1. +13
    -3
      modules/juce_audio_processors/processors/juce_AudioProcessorEditor.cpp

+ 13
- 3
modules/juce_audio_processors/processors/juce_AudioProcessorEditor.cpp View File

@@ -146,10 +146,20 @@ void AudioProcessorEditor::attachResizableCornerComponent()
void AudioProcessorEditor::setBoundsConstrained (Rectangle<int> newBounds)
{
if (constrainer != nullptr)
constrainer->setBoundsForComponent (this, newBounds, false, false, false, false);
else
if (constrainer == nullptr)
{
setBounds (newBounds);
return;
}
auto currentBounds = getBounds();
constrainer->setBoundsForComponent (this,
newBounds,
newBounds.getY() != currentBounds.getY() && newBounds.getBottom() == currentBounds.getBottom(),
newBounds.getX() != currentBounds.getX() && newBounds.getRight() == currentBounds.getRight(),
newBounds.getY() == currentBounds.getY() && newBounds.getBottom() != currentBounds.getBottom(),
newBounds.getX() == currentBounds.getX() && newBounds.getRight() != currentBounds.getRight());
}
void AudioProcessorEditor::editorResized (bool wasResized)


Loading…
Cancel
Save