Avoid drawing text over widget borders in SkinTheme::drawTextString()

This commit is contained in:
David Capello 2014-04-17 16:24:04 -03:00
parent 05507408e1
commit 7989cd81bb
1 changed files with 21 additions and 16 deletions

View File

@ -2000,6 +2000,10 @@ void SkinTheme::drawTextString(Graphics* g, const char *t, ui::Color fg_color, u
} }
// Text // Text
Rect textWrap = textrc.createIntersect(
Rect(widget->getClientBounds()).shrink(widget->getBorder()));
if (IntersectClip clip = IntersectClip(g, textWrap)) {
if (!widget->isEnabled()) { if (!widget->isEnabled()) {
// TODO avoid this // TODO avoid this
if (fill_bg) // Only to draw the background if (fill_bg) // Only to draw the background
@ -2020,6 +2024,7 @@ void SkinTheme::drawTextString(Graphics* g, const char *t, ui::Color fg_color, u
getColor(ThemeColor::Text))), getColor(ThemeColor::Text))),
bg_color, fill_bg, textrc.getOrigin()); bg_color, fill_bg, textrc.getOrigin());
} }
}
} }
void SkinTheme::draw_entry_caret(Entry* widget, int x, int y) void SkinTheme::draw_entry_caret(Entry* widget, int x, int y)