in the AAX wrapper GetViewContainer()->SetViewSize(newSize) can FAIL
this can happen when the plugin is too big (like described in the comments) but also if the offscreen bounds of the plugin are too big.
The result is that the internal size, and the window size are different, which may hide important controls in the plugin (including resize-symbol)
This is a fix for the AAX Wrapper
It remembers the last successful resizing of the plugin, and if it wasn’t successful, it just applies the old size to the internal plugin again.
A listener-loop (because of the component lister) should not happen, because it checks if the current size is equal to the new size)
Point<int> lastCorrectSize;
void childBoundsChanged(Component*) override
{
if (pluginEditor != nullptr)
{
auto w = pluginEditor->getWidth();
auto h = pluginEditor->getHeight();
if (lastCorrectSize.isOrigin() || lastCorrectSize.getX() != w || lastCorrectSize.getY() != h)
{
AAX_Point newSize((float)h, (float)w);
if (owner.GetViewContainer()->SetViewSize(newSize) != AAX_SUCCESS)
{
// Because setViewSize has failed, we have set the internal plugin-size to the same size
// this is tricky because the constrainer may not allow smaller bounds, but if we don't do it the internal size
// is bigger than UI element, and may hide important controls;
auto bounds=pluginEditor->getBounds();
bounds.setWidth(lastCorrectSize.getX());
bounds.setHeight(lastCorrectSize.getY());
pluginEditor->setBoundsConstrained(bounds);
}
else
{
lastCorrectSize.setXY(w, h);
setSize(w, h);
};
};
}
}