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

VST3: Fixed an issue with jumpy resizing when using a fixed aspect ratio

This commit is contained in:
ed 2021-02-25 17:55:20 +00:00
parent 10c77ce296
commit e813531d9b

View file

@ -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)
{