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

Unified Diff: ui/gfx/platform_font_win.cc

Issue 11188005: Merge 161704 - Don't hang if can't downsize font. (Closed) Base URL: svn://svn.chromium.org/chrome/branches/1271/src/
Patch Set: Created 8 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 | ui/gfx/platform_font_win_unittest.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: ui/gfx/platform_font_win.cc
===================================================================
--- ui/gfx/platform_font_win.cc (revision 162156)
+++ ui/gfx/platform_font_win.cc (working copy)
@@ -98,8 +98,14 @@
if (GetHeight() > height) {
const int min_font_size = GetMinimumFontSize();
Font font = DeriveFont(-1, style);
- while (font.GetHeight() > height && font.GetFontSize() != min_font_size) {
+ int font_height = font.GetHeight();
+ int font_size = font.GetFontSize();
+ while (font_height > height && font_size != min_font_size) {
font = font.DeriveFont(-1, style);
+ if (font_height == font.GetHeight() && font_size == font.GetFontSize())
+ break;
+ font_height = font.GetHeight();
+ font_size = font.GetFontSize();
}
return font;
}
« no previous file with comments | « no previous file | ui/gfx/platform_font_win_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698