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

AUv3: Fall back to view size if AUViewControllerBase preferredContentSize property has a zero size when opening plug-in editor

This commit is contained in:
ed 2021-09-06 16:41:31 +01:00
parent ada1b2d693
commit d589f65b36

View file

@ -2411,8 +2411,16 @@ private:
#if JUCE_SUPPORTS_AUv3
void requestViewControllerCallback (AUViewControllerBase* controller)
{
auto nsSize = [controller preferredContentSize];
auto viewSize = CGSizeMake (nsSize.width, nsSize.height);
const auto viewSize = [&controller]
{
auto size = [controller preferredContentSize];
if (size.width == 0 || size.height == 0)
size = controller.view.frame.size;
return CGSizeMake (jmax ((CGFloat) 20.0f, size.width),
jmax ((CGFloat) 20.0f, size.height));
}();
if (! MessageManager::getInstance()->isThisTheMessageThread())
{