VST SDK 3.7 - resizing GUI does not work properly with vst2.4

SDK for VST 3 audio plug-in and host development.
Post Reply
MarkusK
Posts: 53
Joined: Thu Oct 22, 2020 9:11 am

VST SDK 3.7 - resizing GUI does not work properly with vst2.4

Post by MarkusK »

When a GUI is set to a zoomfactor like 150% and then back to 100% the windows is not resized properly. This problem is new with SDK 3.7 and did not appear with 3.6.9

file: vst2wrapper.cpp

Original Code:
tresult PLUGIN_API Vst2EditorWrapper::resizeView (IPlugView* view, ViewRect* newSize)
{
tresult result = kResultFalse;
if (view && newSize && effect)
{
if (areSizeEquals(*newSize, mViewRect))
{
return kResultTrue;
}
auto* effectx = dynamic_cast<AudioEffectX*> (effect);
if (effectx && effectx->sizeWindow (newSize->getWidth (), newSize->getHeight ()))
{
result = view->onSize (newSize);
}
}
return result;
}
Fixed code:
tresult PLUGIN_API Vst2EditorWrapper::resizeView (IPlugView* view, ViewRect* newSize)
{
tresult result = kResultFalse;
if (view && newSize && effect)
{
auto* effectx = dynamic_cast<AudioEffectX*> (effect);
if (effectx && effectx->sizeWindow (newSize->getWidth (), newSize->getHeight ()))
{
result = view->onSize (newSize);
}
}
return result;
}

Post Reply