diff options
author | hbono@chromium.org <hbono@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2008-10-30 16:22:56 +0000 |
---|---|---|
committer | hbono@chromium.org <hbono@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2008-10-30 16:22:56 +0000 |
commit | a2cf67e5986cdbdba24eb2b4ee0ef7be810e7cc7 (patch) | |
tree | e6bc10d56eac0b942b3e0c05e11a5d01614c2306 /chrome/views/text_field.cc | |
parent | f1c7411610f2f849f74eb8d911665e607657a028 (diff) | |
download | chromium_src-a2cf67e5986cdbdba24eb2b4ee0ef7be810e7cc7.zip chromium_src-a2cf67e5986cdbdba24eb2b4ee0ef7be810e7cc7.tar.gz chromium_src-a2cf67e5986cdbdba24eb2b4ee0ef7be810e7cc7.tar.bz2 |
Fix Issue 2918 in chromium: Chrome dialog displayed in large size with Meiryo font.This issue is caused by a font whose text metric |tmAveCharWidth| is not precise as noted in Microsoft Knowledge Base 145994 (*1) To handle this case, this change uses the ChromeFont::horizontal_dlus_to_pixels() function instead of the ChromeFont::ave_char_width() function.(*1) http://support.microsoft.com/kb/145994BUG=2918
Review URL: http://codereview.chromium.org/8051
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@4213 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'chrome/views/text_field.cc')
-rw-r--r-- | chrome/views/text_field.cc | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/chrome/views/text_field.cc b/chrome/views/text_field.cc index be8911d..baa70a1 100644 --- a/chrome/views/text_field.cc +++ b/chrome/views/text_field.cc @@ -847,7 +847,7 @@ void TextField::Layout() { gfx::Size TextField::GetPreferredSize() { gfx::Insets insets; CalculateInsets(&insets); - return gfx::Size(default_width_in_chars_ * font_.ave_char_width() + + return gfx::Size(font_.GetExpectedTextWidth(default_width_in_chars_) + insets.width(), num_lines_ * font_.height() + insets.height()); } |