Hi, I used to centre a component in a Viewport by passing setViewPosition() negative x values but now you have changed
contentComp->setTopLeftPosition (-xPixelsOffset,
-yPixelsOffset);
to
contentComp->setTopLeftPosition (jmax (jmin (0, contentHolder.getWidth() - contentComp->getWidth()), jmin (0, -xPixelsOffset)),
jmax (jmin (0, contentHolder.getHeight() - contentComp->getHeight()), jmin (0, -yPixelsOffset)));
the jmins don’t allow for this. Was doing this a bad idea? If so what is the recommended way to achieve this now?
Cheers, Dave.
