diff --git a/modules/juce_gui_basics/widgets/juce_TextEditor.cpp b/modules/juce_gui_basics/widgets/juce_TextEditor.cpp index 0b21f75ca1..23dc74f43e 100644 --- a/modules/juce_gui_basics/widgets/juce_TextEditor.cpp +++ b/modules/juce_gui_basics/widgets/juce_TextEditor.cpp @@ -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 textBounds (leftIndent, + topIndent, + viewport->getWidth() - leftIndent, + getHeight() - topIndent); + + if (! textBounds.isEmpty()) + g.drawText (textToShowWhenEmpty, textBounds, justification, true); } getLookAndFeel().drawTextEditorOutline (g, getWidth(), getHeight(), *this);