This might be kind of a corner case, but at the beginning of said method there is:
if (flags.dontClipGraphicsFlag)
{
paint (g);
/* yfede: there is no save/restore of the Graphics' state, so opacity, colour,
and origin coordinates that might have been changed inside paint() will
remain, affecting the painting of children that comes afterward */
}
else
{
Graphics::ScopedSaveState ss (g);
if (! (ComponentHelpers::clipObscuredRegions (*this, g, clipBounds, {}) && g.isClipEmpty()))
paint (g);
}
// and then comes the painting of the children
When the dontClipGraphicsFlag is true, it looks like a Graphics::setOpacity(); called inside the paint() might “bleed”, reaching and thus affecting also the painting of the children that comes afterward, because the Graphics state is not saved and restored in that case.
