What is the correct way to draw roated text in Juce? And is it possible, that the function Graphics::addTransform has changed some time ago and is now resetting the bounds?
I am doing the following:
void MyCompoment::paint (Graphics& g)
g.drawSingleLineText("Text One", 70, 30, Justification::left);
//"Text One" is drawn OK
float dbg_bounds = g.getClipBounds().getRight();
//dbg_bounds is 750, just as I set it
g.addTransform(AffineTransform::identity.rotated(-float_Pi / 2.0f));
dbg_bounds = g.getClipBounds().getRight();
//strangely, dbg_bounds is 1 now. It seems, addTransform resetted it
//because the bounds has size 1, the "Text Two" is not shown
So basically I am using addTransform in order to draw rotated text. The problem is: After I call addTransform, the bounds of my Graphics object are reset to 1. As a result, no text is drawn, because everything is clipped.
The physical clip bounds of a Graphics don't change, but when you apply a transform, then obviously those bounds will appear to be in a different place, because the whole coordinate space has now changed.