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

Unified Diff: views/controls/label.cc

Issue 361001: While changing the label class I added a DCHECK to make sure the function... (Closed) Base URL: svn://chrome-svn/chrome/trunk/src/
Patch Set: Created 11 years, 1 month 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: views/controls/label.cc
===================================================================
--- views/controls/label.cc (revision 30863)
+++ views/controls/label.cc (working copy)
@@ -418,7 +418,12 @@
}
void Label::UpdateContainsMouse(const MouseEvent& event) {
- SetContainsMouse(GetTextBounds().Contains(event.x(), event.y()));
+ if (is_multi_line_) {
+ gfx::Rect rect(width(), GetHeightForWidth(width()));
+ SetContainsMouse(rect.Contains(event.x(), event.y()));
+ } else {
+ SetContainsMouse(GetTextBounds().Contains(event.x(), event.y()));
+ }
}
void Label::SetContainsMouse(bool contains_mouse) {
« 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