Skip to content

Commit

Permalink
VST3: Set the isStretchingTop/Left/Bottom/Right arguments of Componen…
Browse files Browse the repository at this point in the history
…tBoundsConstrainer::checkBounds() to fix some resizing issues when using a constrainer with a fixed aspect ratio
  • Loading branch information
ed95 committed Sep 4, 2018
1 parent 02f8a12 commit ddddf0d
Showing 1 changed file with 8 additions and 1 deletion.
9 changes: 8 additions & 1 deletion modules/juce_audio_plugin_client/VST3/juce_VST3_Wrapper.cpp
Expand Up @@ -944,7 +944,14 @@ class JuceVST3EditController : public Vst::EditController,
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);

Expand Down

0 comments on commit ddddf0d

Please sign in to comment.