Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(55)

Unified Diff: ui/views/controls/label.cc

Issue 870903002: Do not invoke DrawFadedString() if it knows it does not fade. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 5 years, 11 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « no previous file | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: ui/views/controls/label.cc
diff --git a/ui/views/controls/label.cc b/ui/views/controls/label.cc
index 6b8fa5835e84d202157f8d5bd3ee26e092d3d191..979a5b0032ac0fbd931e8aee2221264293c6e4e3 100644
--- a/ui/views/controls/label.cc
+++ b/ui/views/controls/label.cc
@@ -347,7 +347,8 @@ void Label::PaintText(gfx::Canvas* canvas,
const gfx::Rect& text_bounds,
int flags) {
SkColor color = enabled() ? actual_enabled_color_ : actual_disabled_color_;
- if (elide_behavior_ == gfx::FADE_TAIL) {
+ if (elide_behavior_ == gfx::FADE_TAIL &&
+ text_bounds.width() < GetTextSize().width()) {
canvas->DrawFadedString(text, font_list_, color, text_bounds, flags);
} else {
canvas->DrawStringRectWithShadows(text, font_list_, color, text_bounds,
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698