[Bug?] AlertWindow message goes off the alert box

Hello,

we’ve been facing an issue with the AlertWindow where the message text goes out of the box bounds (see the image).

We’re using JUCE 7.0.5 and the AlertWindow is not added to the Desktop, it is a child component of the main editor instead (as we needed a reference to it in order to dismiss it automatically upon a certain event).
Its associated component is the top level component of the app, in case you’re wondering.

Upon some investigation, I’ve noticed this code in the AlertWindow class:

if (alertIconType == NoIcon)
    {
        attributedText.setJustification (Justification::centredTop);
        textLayout.createLayoutWithBalancedLineLengths (attributedText, (float) w);
    }
    else
    {
        attributedText.setJustification (Justification::topLeft);
        textLayout.createLayoutWithBalancedLineLengths (attributedText, (float) w);
        iconSpace = iconWidth;
    }

and I’m wondering: if the icon is visible, shouldn’t the text layout width be reduced to compensate for the shift, in order to make the text always fit inside the box space?

Something like:

textLayout.createLayoutWithBalancedLineLengths (attributedText, (float) (w - iconWidth));

We’ve been able to fix it in the look and feel by removing the icon space shift, but I’m wondering if this is a bug or I’m missing something.

Thanks,
Federico Berti