If I add this line in the first line of the PluginEditor’s constructor…
Desktop::getInstance().setGlobalScaleFactor(1.31511f);
… then I set the PluginEditor’s size later in the constructor, then somehow the parent of the editor will get an x;y offset of a few pixels leaving unoccupied space in the top and left of the Editor.
It seems reSetting the size of the Editor later, whenever it is already added to a parent will realign the positions and removes the gaps… Obviously setting the size again wouldn’t do the trick so setting it to 0;0 then set it to the original size will fix the alignment (but not in the constructor as then it doesn’t have a parent yet).
It seems not every scalefactor causes this, so maybe it’s some kind of rounding problem:
- I can’t repro this if the scalefactor is <= 1.0f
- depending on the actual size of the plugin some scale factors introduce the offset, some not.
I just creted a brand new JUCE project and did nothing but added the next line before the setSize(400,400):
juce::Desktop::getInstance().setGlobalScaleFactor(1.31511f);
this is how Ableton shows the window: