Chromium Code Reviews| Index: views/controls/label.cc |
| diff --git a/views/controls/label.cc b/views/controls/label.cc |
| old mode 100644 |
| new mode 100755 |
| index 6da6c48e2cfb6f30b830c83632dabbf9b865d0fc..6b17338150600b0787614771dbdaa3c6e0c74b09 |
| --- a/views/controls/label.cc |
| +++ b/views/controls/label.cc |
| @@ -264,7 +264,12 @@ const GURL Label::GetURL() const { |
| gfx::Size Label::GetTextSize() { |
| if (!text_size_valid_) { |
| - text_size_.SetSize(font_.GetStringWidth(text_), font_.height()); |
| + int w = 0, h = 0; |
|
Evan Stade
2009/10/23 18:06:29
nit: move declaration to where it's used
DaveMoore
2009/10/23 18:11:10
To me...this is where it's used. All three declara
|
| + 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); |
| if (highlighted_) |
| text_size_.Enlarge(1, 1); |
| text_size_valid_ = true; |