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

VST3: Set the isStretchingTop/Left/Bottom/Right arguments of ComponentBoundsConstrainer::checkBounds() to fix some resizing issues when using a constrainer with a fixed aspect ratio

This commit is contained in:
ed 2018-09-04 13:59:01 +01:00
parent 02f8a125c4
commit ddddf0dbd4

View file

@ -944,7 +944,14 @@ private:
if (auto* constrainer = editor->getConstrainer())
{
Rectangle<int> limits (0, 0, constrainer->getMaximumWidth(), constrainer->getMaximumHeight());
constrainer->checkBounds (juceRect, editor->getBounds(), limits, false, false, false, false);
auto currentRect = editor->getBounds();
constrainer->checkBounds (juceRect, currentRect, limits,
juceRect.getY() != currentRect.getY() && juceRect.getBottom() == currentRect.getBottom(),
juceRect.getX() != currentRect.getX() && juceRect.getRight() == currentRect.getRight(),
juceRect.getY() == currentRect.getY() && juceRect.getBottom() != currentRect.getBottom(),
juceRect.getX() == currentRect.getX() && juceRect.getRight() != currentRect.getRight());
juceRect = component->getLocalArea (editor, juceRect);