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:
parent
10c77ce296
commit
e813531d9b
1 changed files with 8 additions and 9 deletions
|
|
@ -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)
|
||||
{
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue