From ad8f2013b58ea2848ac308ba2be4c3c593b2ff93 Mon Sep 17 00:00:00 2001 From: ed Date: Fri, 12 Mar 2021 14:44:54 +0000 Subject: [PATCH] AudioProcessorEditor: Set ComponentBoundsConstrainer stretchingTop/Left/Bottom/Right values when calling setBoundsForComponent() --- .../processors/juce_AudioProcessorEditor.cpp | 16 +++++++++++++--- 1 file changed, 13 insertions(+), 3 deletions(-) diff --git a/modules/juce_audio_processors/processors/juce_AudioProcessorEditor.cpp b/modules/juce_audio_processors/processors/juce_AudioProcessorEditor.cpp index 7db87b2858..30249c0a53 100644 --- a/modules/juce_audio_processors/processors/juce_AudioProcessorEditor.cpp +++ b/modules/juce_audio_processors/processors/juce_AudioProcessorEditor.cpp @@ -146,10 +146,20 @@ void AudioProcessorEditor::attachResizableCornerComponent() void AudioProcessorEditor::setBoundsConstrained (Rectangle 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)