Chromium Code Reviews| Index: ui/gfx/render_text.cc |
| diff --git a/ui/gfx/render_text.cc b/ui/gfx/render_text.cc |
| index d3c6bea6ffe682b03d68e8e071f991769e5edaa8..a756b096cef905dd1e3728b122052fd228213eac 100644 |
| --- a/ui/gfx/render_text.cc |
| +++ b/ui/gfx/render_text.cc |
| @@ -348,6 +348,9 @@ void RenderText::SetVerticalAlignment(VerticalAlignment alignment) { |
| void RenderText::SetFontList(const FontList& font_list) { |
| font_list_ = font_list; |
| + // Cache the height and baseline of the font list. |
| + font_list_height_ = font_list_.GetHeight(); |
|
msw
2013/07/11 22:47:29
Init these values to 0 in the ctor.
Yuki
2013/07/12 08:25:53
Done.
|
| + font_list_baseline_ = font_list_.GetBaseline(); |
| cached_bounds_and_offset_valid_ = false; |
| ResetLayout(); |
| } |
| @@ -357,9 +360,7 @@ void RenderText::SetFont(const Font& font) { |
| } |
| void RenderText::SetFontSize(int size) { |
| - font_list_ = font_list_.DeriveFontListWithSize(size); |
| - cached_bounds_and_offset_valid_ = false; |
| - ResetLayout(); |
| + SetFontList(font_list_.DeriveFontListWithSize(size)); |
| } |
| void RenderText::SetCursorEnabled(bool cursor_enabled) { |