Hi everyone, I’m still fairly new to JUCE, just doing a project using it and so far it’s been quite nice to work with, but I have run across what may be a bug with gui scaling and clipping bounds in Audio Units.
[Some edits here because I managed to confuse myself a bit before…]
I’m building a both a standalone version and AU plugin version of the app, and they behave differently when using setGlobalScaleFactor() and setSize(), but that’s not a big issue in itself.
This is what I do in the standalone version which seems to work nicely:
Desktop::getInstance().setGlobalScaleFactor(scale);
setSize(originalEditorWidth, originalEditorHeight);
This is what I have to do in the plugin version to get the window to resize:
Desktop::getInstance().setGlobalScaleFactor(scale);
setSize(scale * originalEditorWidth, scale * originalEditorHeight);
For some reason the setSize() dimensions need to be scaled only in the plugin version, and that would be fine if it worked. However, it’s like the clip area then gets scaled down twice in the plugin, so it ends up smaller than the window, and only part of the plugin gets painted!
I have tried spelunking through the framework code a bit now, but as I’m a noob I can’t find an obvious fix for the clipping problem.
If anyone can help with this I’d be ever so happy!
Thanks, Jules
(No, not that Jules, I’m another Jules. Maybe just call me jc_lounge or Julian to avoid confusion! )