# Resizable Plugin - how to?

**URL:** <https://forum.juce.com/t/resizable-plugin-how-to/45043>\
**Category:** Audio Plugins\
**Created:** [March 16, 2021, 4:29pm UTC](https://forum.juce.com/t/resizable-plugin-how-to/45043 "2021-03-16T16:29:07Z")\
**Posts on this page:** 8\
**Page:** 1

<div class="post-metadata">

**Author:** ![petervorlaender](https://sea2.discourse-cdn.com/flex026/user_avatar/forum.juce.com/petervorlaender/32/13489_2.png) [@petervorlaender](https://forum.juce.com/u/petervorlaender)\
**Post date:** [March 16, 2021, 4:29pm UTC](https://forum.juce.com/t/resizable-plugin-how-to/45043/1 "2021-03-16T16:29:07Z")

</div>

I am trying to have my plugin resizable. My requirements seem modest:

1. Give the user the possibility to resize my plugin by dragging
2. impose a fixed ratio, mininmal and maximal dimensions
3. work reliable with win10 & mac as VST3 and AU on the usual hosts

My question is _not_ about how to handle the layout and drawing, my question is on setting it up such that my plugin editor receives the information about resize and allows constraining it, without ugly black borders between my plugin and the window containing it.

I thought this is simple problem … however, it turned out to be tough. I also found dozens of posts in the forum where people reported similar problems again and again. Also the AudioPluginDemo suffers from all kind of resize issues, eg with VST3 on WIN10 in Ableton: you can resize the outer frame such that you get ugly black border, or you shrink the outer window and “cut” the plugin area short, because it does not get the resize events.

Obviously I am doing something wrong, and obviously there must be a solution for this … so can anyone help me?

Many thanks in advance!  
Peter

---

<div class="post-metadata">

**Author:** ![reuk](https://sea2.discourse-cdn.com/flex026/user_avatar/forum.juce.com/reuk/32/21494_2.png) [@reuk](https://forum.juce.com/u/reuk)\
**Post date:** [March 16, 2021, 5:19pm UTC](https://forum.juce.com/t/resizable-plugin-how-to/45043/2 "2021-03-16T17:19:43Z")

</div>

Are you using the very latest version of JUCE from the `develop` branch? Some changes were made in this area in the last few days, so if you haven’t updated for a while it’s worth checking out the newest version.

Here, the AudioPluginDemo resizes correctly when loaded as a VST3 in Live 11 on Windows 10. Resizing using the border of the host window resizes the plugin completely smoothly. Resizing using the plugin’s internal corner resizer is slightly less smooth, with the plugin view being trimmed or bordered briefly. However, the host window always quickly catches up with the editor’s new size.

---

<div class="post-metadata">

**Author:** ![daniel](https://sea2.discourse-cdn.com/flex026/user_avatar/forum.juce.com/daniel/32/790_2.png) [@daniel](https://forum.juce.com/u/daniel)\
**Post date:** [March 16, 2021, 5:23pm UTC](https://forum.juce.com/t/resizable-plugin-how-to/45043/3 "2021-03-16T17:23:41Z")

</div>

Is there ever a way to resize from the border in AU (especially Logic) as well?  
Seems not possible to me.

(Sorry for hijacking)

---

<div class="post-metadata">

**Author:** ![reuk](https://sea2.discourse-cdn.com/flex026/user_avatar/forum.juce.com/reuk/32/21494_2.png) [@reuk](https://forum.juce.com/u/reuk)\
**Post date:** [March 16, 2021, 5:30pm UTC](https://forum.juce.com/t/resizable-plugin-how-to/45043/4 "2021-03-16T17:30:42Z")

</div>

I’m not aware of any AUv2s which implement this, no. For AUv2, it seems that client-initiated resize via a corner resizer or similar is necessary.

Annoyingly, the opposite seems to be true for AUv3, where _only_ host-initiated resize seems to have any effect.

---

<div class="post-metadata">

**Author:** ![daniel](https://sea2.discourse-cdn.com/flex026/user_avatar/forum.juce.com/daniel/32/790_2.png) [@daniel](https://forum.juce.com/u/daniel)\
**Post date:** [March 16, 2021, 5:32pm UTC](https://forum.juce.com/t/resizable-plugin-how-to/45043/5 "2021-03-16T17:32:56Z")

</div>

Yes, the only AUv2 that allow to drag the border are the Apple built in ones.  
Funnily Logic keeps showing the resizer cursors over the border regardless if the plugin is resizable or not.  
I suspect they have a private/undocumented API to receive the dragging events from the border…

---

<div class="post-metadata">

**Author:** ![petervorlaender](https://sea2.discourse-cdn.com/flex026/user_avatar/forum.juce.com/petervorlaender/32/13489_2.png) [@petervorlaender](https://forum.juce.com/u/petervorlaender)\
**Post date:** [March 17, 2021, 12:37pm UTC](https://forum.juce.com/t/resizable-plugin-how-to/45043/6 "2021-03-17T12:37:22Z")

</div>

Ok, cool. Tried out on latest dev and its fixed there - thank you @reuk!  
Will these fixes be available on the main branch anywhere soon?

---

<div class="post-metadata">

**Author:** ![reuk](https://sea2.discourse-cdn.com/flex026/user_avatar/forum.juce.com/reuk/32/21494_2.png) [@reuk](https://forum.juce.com/u/reuk)\
**Post date:** [March 17, 2021, 1:08pm UTC](https://forum.juce.com/t/resizable-plugin-how-to/45043/7 "2021-03-17T13:08:49Z")

</div>

No fixed date yet, but these changes will be part of the next version release.

---

<div class="post-metadata">

**Author:** ![DKDiveDude](https://sea2.discourse-cdn.com/flex026/user_avatar/forum.juce.com/dkdivedude/32/7020_2.png) [@DKDiveDude](https://forum.juce.com/u/DKDiveDude)\
**Post date:** [March 17, 2021, 2:34pm UTC](https://forum.juce.com/t/resizable-plugin-how-to/45043/8 "2021-03-17T14:34:33Z")

</div>

Here is what I got in the beginning of my PluginEditor.cpp’s constructor;

```auto
    setResizable (true, true);
	setResizeLimits (1278, 700, 1918, 1050);

	const float ratio = 1.83f;
	getConstrainer ()->setFixedAspectRatio (ratio);

	appWidth = 1918;
	appHeight = 1050;
    setSize (appWidth, appHeight);

```
