There seems to be a difference between J7 and J8 in how drawFittedText works. There’s two issues:
- The text draws outside the rectangle specified
- The text isn’t broken at the same point
J7:


J8:


To repo, add this to the Widgets button demo:
void paint (Graphics& g) override
{
auto r = components.getLast()->getBounds()
.translated (120, 0)
.withWidth (64).withHeight (60);
g.setColour (Colours::red.withAlpha (0.3f));
g.fillRect (r);
g.setColour (Colours::white);
g.drawFittedText ("Looooooooooong Short Medium",
r, juce::Justification::centred, 6);
}
This is particularly problematic if you have setPaintingIsUnclipped enabled for components as the text will happily bleed in to neighbouring components.
This happens with the CoreGraphics, Software and Direct2D renderers.
Thanks in advance.
