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:
parent
e0883ace58
commit
8ee13b78ba
1 changed files with 7 additions and 4 deletions
|
|
@ -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);
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue