I’m working on a plugin which starts in a “basic mode” but has an “advanced” button which opens another section underneath the basic section when the user clicks it. When the advanced button is clicked, the plugin calls
setSize to increase its height and maintain the appropriate aspect ratio. This works well in the standalone version, but some DAWs create a container window around the plugin and clamp the size of that window to fit on the screen at all times. When this happens, and the host shrinks the plugin window, the values returned by
getHeight in the
resized callback do not update correctly, but return the original parameters passed to
setSize. Thus, the plugin paints outside the bounds of the window and contents are clipped. As soon as I drag the bottom-right corner and resize the window, the width/height are correct again.
Here’s a screenshot of it painting outside the correct bounds:
Not sure if I’m doing something wrong here, but I’ve been struggling to find any information in the JUCE docs or other forum posts about how to get the “actual” container size (some posts seem to indicate that it’s not even possible, but they seem to be focused on getting the frame border of the container rather than the local bounds).