1
0
Fork 0
mirror of https://github.com/juce-framework/JUCE.git synced 2026-01-17 00:44:19 +00:00

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

This commit is contained in:
ed 2021-03-12 14:44:54 +00:00
parent df06a471c0
commit ad8f2013b5

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)