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

Unified Diff: ui/gfx/render_text.cc

Issue 18848002: Shows Japanese and English mixed queries correctly. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Adds a unit test. Created 7 years, 5 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
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) {

Powered by Google App Engine
This is Rietveld 408576698