From e813531d9bf0e2a7768224fb8277b85b746b94c9 Mon Sep 17 00:00:00 2001 From: ed Date: Thu, 25 Feb 2021 17:55:20 +0000 Subject: [PATCH] VST3: Fixed an issue with jumpy resizing when using a fixed aspect ratio --- .../VST3/juce_VST3_Wrapper.cpp | 17 ++++++++--------- 1 file changed, 8 insertions(+), 9 deletions(-) diff --git a/modules/juce_audio_plugin_client/VST3/juce_VST3_Wrapper.cpp b/modules/juce_audio_plugin_client/VST3/juce_VST3_Wrapper.cpp index 2ffe8185cc..f0013bf3e4 100644 --- a/modules/juce_audio_plugin_client/VST3/juce_VST3_Wrapper.cpp +++ b/modules/juce_audio_plugin_client/VST3/juce_VST3_Wrapper.cpp @@ -1371,18 +1371,17 @@ private: if (aspectRatio != 0.0) { - auto adjustWidth = [&] + bool adjustWidth = (width / height > aspectRatio); + + if (getHostType().type == PluginHostType::SteinbergCubase9) { auto currentEditorBounds = editor->getBounds().toFloat(); - auto stretchingBottom = (currentEditorBounds.getBottom() != editorBounds.getBottom()); - auto stretchingRight = (currentEditorBounds.getRight() != editorBounds.getRight()); - - if (getHostType().isReaper() || stretchingBottom == stretchingRight) - return currentEditorBounds.getAspectRatio() > (width / height); - - return stretchingBottom; - }(); + if (currentEditorBounds.getWidth() == width && currentEditorBounds.getHeight() != height) + adjustWidth = true; + else if (currentEditorBounds.getHeight() == height && currentEditorBounds.getWidth() != width) + adjustWidth = false; + } if (adjustWidth) {