Avoiding artefacts when rotating images


I’m drawing a circular rotating graph with text labels rotated to fit and noticing some artefacts in the rotated text. Is there way to avoid this?

I’m calling e.g.

g.addTransform(AffineTransform::identity.rotated(angle, localBounds.getCentreX(), localBounds.getCentreY()));
g.drawSingleLineText (label, x, y, Justification::left);

This on iOS.


Actually, I am also rotating the whole image (its a moving dial with text labels).
I’m currently buffering the whole graph component with setBufferedToImage and then rotating it via setTransform. Only the top part of the graph is visible.

I wonder if there is a neat way to buffer the image at 2x size, and then rotate and scale down each time to avoid sampling artifacts when rotating?

I did also try setting the angle in the component itself rather than rotating it, but I got some weird behaviour with text jiggling around as it rotated.