I have an unusual situation where my plugin UI background is about 2% bigger than it should be, only when I “reopen” the plugin. (The knobs and buttons remain the correct size).
Only when I close the plugin, and then double-click on the plugin in my FX list to reopen it, does this 2% size increase occur.
If I make a new instance of the plugin, then the UI background size is correct, or if I close the DAW completely (with my plugin showing) and relaunch the DAW, the plugin appears again at correct size. Its only the reopen that the size issue occurs.
I am learning about visibilityChanged()
- could that be a place where I could reset the UI size? I’m guessing paint() and resized() are called too frequently for something as heavy as a UI reset.
In tried some visibilityChanged()
code
void myplugineditor::visibilityChanged()
{
DBG("It reaches here when the plugin is reopened, as expected");
if (isVisible())
{
//My code to make sure UI background is correct size
}
}