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

Unified Diff: chrome/renderer/print_web_view_helper.cc

Issue 10837080: Work-around Windows 8 bug causing print footers and headers to have incorrect size. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src/
Patch Set: Created 8 years, 4 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 | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: chrome/renderer/print_web_view_helper.cc
===================================================================
--- chrome/renderer/print_web_view_helper.cc (revision 149502)
+++ chrome/renderer/print_web_view_helper.cc (working copy)
@@ -443,8 +443,13 @@
horizontal_position,
vertical_position, offset_to_baseline,
text_width_in_points);
- paint->SetFontSize(printing::kSettingHeaderFooterFontSize /
- webkit_scale_factor);
+ // Set the scaled font size before drawing the text.
+ // This creates a new font instead of calling |paint->SetFontSize()| to work
+ // around a Windows 8 bug. See: http://crbug.com/139206
+ gfx::FontList font_list(
+ gfx::Font(printing::kSettingHeaderFooterFontFamilyName,
+ printing::kSettingHeaderFooterFontSize / webkit_scale_factor));
+ paint->SetFontList(font_list);
gfx::Size size(paint->GetStringSize());
gfx::Rect rect(point.x(), point.y() - paint->GetBaseline(),
size.width(), size.height());
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698