Browse Source

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

v6.1.6
ed 4 years ago
parent
commit
d589f65b36
1 changed files with 10 additions and 2 deletions
  1. +10
    -2
      modules/juce_audio_processors/format_types/juce_AudioUnitPluginFormat.mm

+ 10
- 2
modules/juce_audio_processors/format_types/juce_AudioUnitPluginFormat.mm 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())
{


Loading…
Cancel
Save