I’m having a problem rescaling my plug-in only on Windows and in some DAWs like Pro Tools. I’m puzzled on what’s going on so I’ll make some statements first:
- Everything works fine in Mac. This issue is only present in Windows.
- Everything works fine in Reaper, which is my main DAW for debugging.
- I’m able to replicate the issue in Juce PluginHost.
- I’m testing everything on a Microsoft Surface Laptop.
- I have the latest JUCE version on develop (pulled a few days ago).
- Using Visual Studio 2017 and Windows 10.
- Everything works fine if the default Windows scaling is set to 100%, problems come if the default resolution is set to anything but 100%. I have it on 150%, which is the recommended setting.
- Everything works fine when opening the UI.
By reference, this is how the plug-in should look:
In resized() I’m positioning all elements like this:
myComponent->setBounds(roundToInt(45.f * scale), roundToInt(87.f * scale), roundToInt(100.f * scale), roundToInt(100.f * scale));
The “scale” is a float that I change its value from 0.5f to 2.f (50% to 200% size), selectable by the user like this:
scale = 1.25f;
setSize(roundToInt(650.f * scale), roundToInt(560.f * scale));
I launch PluginHost and load the plug-in. If I change the plug-in size and the Windows scaling is set to something else than 100% the UI is cropped. It looks like this:
Closing and opening the window again makes it look perfect. Changing the size again makes it look cropped.
Enabling DPI awareness inside PluginHost works.
These are my settings in Windows scaling (in spanish):
I have tested this with another plug-in that I know it’s made with JUCE and the same issue can be replicated.
However, “Sugar”, the plug-in from process.Audio developed by Ivan Cohen, works fine in all cases. I have been talking with Ivan about this and we haven’t come to an understanding of what I’m doing wrong, or what he is doing right
I’m puzzled about this, any help appreciated!
Edit: Ivan tells me that he is using an older version of JUCE for the Sugar plug-in. JUCE 5.3.2.
Edit 2: This is a video of Reels by Audiothing. It has a Resiable Corner and I think it can better explain what’s going on. It looks like there’s a SetSize missing somewhere. https://streamable.com/6l55i