Browse Source

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

tags/2021-05-28
ed 6 years ago
parent
commit
ddddf0dbd4
1 changed files with 8 additions and 1 deletions
  1. +8
    -1
      modules/juce_audio_plugin_client/VST3/juce_VST3_Wrapper.cpp

+ 8
- 1
modules/juce_audio_plugin_client/VST3/juce_VST3_Wrapper.cpp View File

@@ -944,7 +944,14 @@ private:
if (auto* constrainer = editor->getConstrainer()) if (auto* constrainer = editor->getConstrainer())
{ {
Rectangle<int> limits (0, 0, constrainer->getMaximumWidth(), constrainer->getMaximumHeight()); 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); juceRect = component->getLocalArea (editor, juceRect);


Loading…
Cancel
Save