mirror of
https://github.com/juce-framework/JUCE.git
synced 2026-01-28 02:30:05 +00:00
VST3 Host: Constrain editor view to prevent it being resized beyond the minimum size recommended by the plugin
This commit is contained in:
parent
eeb6230db4
commit
6015900d6d
1 changed files with 15 additions and 0 deletions
|
|
@ -1479,6 +1479,7 @@ static std::shared_ptr<const ARA::ARAFactory> getARAFactory (VST3ModuleHandle& m
|
|||
//==============================================================================
|
||||
struct VST3PluginWindow final : public AudioProcessorEditor,
|
||||
private ComponentMovementWatcher,
|
||||
private ComponentBoundsConstrainer,
|
||||
private IPlugFrame
|
||||
{
|
||||
VST3PluginWindow (AudioPluginInstance* owner, IPlugView* pluginView)
|
||||
|
|
@ -1492,6 +1493,7 @@ struct VST3PluginWindow final : public AudioProcessorEditor,
|
|||
setSize (10, 10);
|
||||
setOpaque (true);
|
||||
setVisible (true);
|
||||
setConstrainer (this);
|
||||
|
||||
warnOnFailure (view->setFrame (this));
|
||||
view->queryInterface (Steinberg::IPlugViewContentScaleSupport::iid, (void**) &scaleInterface);
|
||||
|
|
@ -1565,6 +1567,19 @@ struct VST3PluginWindow final : public AudioProcessorEditor,
|
|||
bool keyPressed (const KeyPress& /*key*/) override { return true; }
|
||||
|
||||
private:
|
||||
void checkBounds (Rectangle<int>& bounds,
|
||||
const Rectangle<int>&,
|
||||
const Rectangle<int>&,
|
||||
bool,
|
||||
bool,
|
||||
bool,
|
||||
bool) override
|
||||
{
|
||||
auto rect = componentToVST3Rect (bounds);
|
||||
view->checkSizeConstraint (&rect);
|
||||
bounds = vst3ToComponentRect (rect);
|
||||
}
|
||||
|
||||
//==============================================================================
|
||||
void componentPeerChanged() override {}
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue