Skip to content

Commit

Permalink
Allow child NSView to resize the wrapper NSView in Audio Units. (#249)
Browse files Browse the repository at this point in the history
Co-authored-by: Joseph Lyncheski <[email protected]>
  • Loading branch information
defiantnerd and directmusic committed May 8, 2024
1 parent 68a00da commit 2e2c69d
Showing 1 changed file with 12 additions and 1 deletion.
13 changes: 12 additions & 1 deletion src/detail/auv2/wrappedview.asinclude.mm
Original file line number Diff line number Diff line change
Expand Up @@ -111,7 +111,18 @@ - (id)initWithAUv2:(free_audio::auv2_wrapper::ui_connection *)cont preferredSize
gui->set_parent(ui._plugin->_plugin, &m);
gui->set_scale(ui._plugin->_plugin, 1.0);

if (gui->can_resize(ui._plugin->_plugin)) gui->set_size(ui._plugin->_plugin, size.width, size.height);
if (gui->can_resize(ui._plugin->_plugin))
{
clap_gui_resize_hints_t resize_hints;
gui->get_resize_hints(ui._plugin->_plugin, &resize_hints);
NSAutoresizingMaskOptions mask = 0;

if (resize_hints.can_resize_horizontally) mask |= NSViewWidthSizable;
if (resize_hints.can_resize_vertically) mask |= NSViewHeightSizable;

[self setAutoresizingMask:mask];
gui->set_size(ui._plugin->_plugin, size.width, size.height);
}

idleTimer = nil;
CFTimeInterval TIMER_INTERVAL = .05; // In SurgeGUISynthesizer.h it uses 50 ms
Expand Down

0 comments on commit 2e2c69d

Please sign in to comment.