ContentComponent off center on iPhone

Was nicely centered until JUCE 2.0.17… updated to 2.0.21 today and the whole thing is halfway off the screen. Any change I should be aware of?

Hmm, not sure what that could be… I tarted-up the screen size methods in the Desktop class, but it should all still work. When you say “ContentComponent”, there’s actually no such class, so what exactly are you doing?

This is what I’m doing in the main app window:

    : DocumentWindow (JUCEApplication::getInstance()->getApplicationName(),
    instrument = new TwoD_Instrument();
    Desktop::getInstance().setOrientationsEnabled(Desktop::rotatedClockwise | Desktop::rotatedAntiClockwise);
    Rectangle<int> Monitor=Desktop::getInstance().getMainMonitorArea();
    int width=Monitor.getWidth();
    int height=Monitor.getHeight();
    setContentOwned(instrument, true);
    setVisible (true);

Why are you setting the size of the content component? Surely better to just put the documentwindow into full-screen mode?

i thought it needed a size or it blew. i’ve been using,

setContentOwned(instrument, false);

disclaimer: not tested on this case.

Yes, you might be right that it needs some kind of non-zero size to keep it happy, but in the snippet he’s setting it to the size of the whole screen, without taking the window border into account, when it’d make more sense to just make the window fullscreen and let the content take whatever size it is given.

Ok, thanks, works fine again… still a bit strange that my “old way” gives an unexpected result now.

Well, I’d certainly have expected that code to create a window that’s too big. More surprising that it ever worked in the old version!