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

Unified Diff: components/printing/renderer/print_web_view_helper.cc

Issue 2667793002: Fix windows margin scaling bug (Closed)
Patch Set: Created 3 years, 11 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: components/printing/renderer/print_web_view_helper.cc
diff --git a/components/printing/renderer/print_web_view_helper.cc b/components/printing/renderer/print_web_view_helper.cc
index 4f49e16676cf1ed35673a569f9a6e75afc4a3c02..8fbc28ebf4054e483f6cfaf9e79ce3ef224a2a6f 100644
--- a/components/printing/renderer/print_web_view_helper.cc
+++ b/components/printing/renderer/print_web_view_helper.cc
@@ -1853,11 +1853,16 @@ void PrintWebViewHelper::PrintPageInternal(
int dpi = static_cast<int>(params.params.dpi);
// Calculate the actual page size and content area in dpi.
if (page_size_in_dpi) {
+ // Windows uses this for the actual page size. We have scaled page size
+ // to get blink to reflow the page, so scale it back to the real size
+ // before returning it.
*page_size_in_dpi =
gfx::Size(static_cast<int>(ConvertUnitDouble(page_size.width(),
- kPointsPerInch, dpi)),
+ kPointsPerInch, dpi) *
+ css_scale_factor),
static_cast<int>(ConvertUnitDouble(page_size.height(),
- kPointsPerInch, dpi)));
+ kPointsPerInch, dpi) *
+ css_scale_factor));
}
if (content_area_in_dpi) {
« 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