1
0
Fork 0
mirror of https://github.com/juce-framework/JUCE.git synced 2026-01-10 23:44:24 +00:00

Avoid drawing TextEditor "empty" text when it isn't visible

This commit is contained in:
ed 2020-11-16 16:10:13 +00:00
parent e0883ace58
commit 8ee13b78ba

View file

@ -1730,10 +1730,13 @@ void TextEditor::paintOverChildren (Graphics& g)
g.setColour (colourForTextWhenEmpty);
g.setFont (getFont());
g.drawText (textToShowWhenEmpty,
leftIndent, topIndent,
viewport->getWidth() - leftIndent, getHeight() - topIndent,
justification, true);
Rectangle<int> textBounds (leftIndent,
topIndent,
viewport->getWidth() - leftIndent,
getHeight() - topIndent);
if (! textBounds.isEmpty())
g.drawText (textToShowWhenEmpty, textBounds, justification, true);
}
getLookAndFeel().drawTextEditorOutline (g, getWidth(), getHeight(), *this);