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

Unified Diff: views/controls/label.cc

Issue 337018: Previous change to label caused incorrect layout in Windows. (Closed)
Patch Set: Compile error fixed. Created 11 years, 2 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: views/controls/label.cc
diff --git a/views/controls/label.cc b/views/controls/label.cc
index 6b17338150600b0787614771dbdaa3c6e0c74b09..6da6c48e2cfb6f30b830c83632dabbf9b865d0fc 100755
--- a/views/controls/label.cc
+++ b/views/controls/label.cc
@@ -264,12 +264,7 @@ const GURL Label::GetURL() const {
gfx::Size Label::GetTextSize() {
if (!text_size_valid_) {
- int w = 0, h = 0;
- gfx::Canvas cc(0, 0, true);
- int flags = is_multi_line_ ? ComputeMultiLineFlags() : 0;
-
- cc.SizeStringInt(text_, font_, &w, &h, flags);
- text_size_.SetSize(w, h);
+ text_size_.SetSize(font_.GetStringWidth(text_), font_.height());
if (highlighted_)
text_size_.Enlarge(1, 1);
text_size_valid_ = true;
« 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