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

Unified Diff: printing/print_settings_initializer_gtk.cc

Issue 4732002: Fix DCHECK failure in page_setup.cc on Linux. (Closed)
Patch Set: Created 10 years, 1 month 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: printing/print_settings_initializer_gtk.cc
diff --git a/printing/print_settings_initializer_gtk.cc b/printing/print_settings_initializer_gtk.cc
index fd7a5fda1b0c3a234b8107ad168376c37d1cc5d2..60ab530a7cdb4a9549c82ef2d87c1c57e6d95620 100644
--- a/printing/print_settings_initializer_gtk.cc
+++ b/printing/print_settings_initializer_gtk.cc
@@ -62,11 +62,15 @@ void PrintSettingsInitializerGtk::InitPrintSettings(
static_cast<int>(page_height_in_pixel));
printable_area_device_units.SetRect(
static_cast<int>(
- NativeMetafile::kLeftMarginInInch * printing::kPixelsPerInch),
+ NativeMetafile::kLeftMarginInInch * dpi),
static_cast<int>(
- NativeMetafile::kTopMarginInInch * printing::kPixelsPerInch),
- page_width_in_pixel,
- page_height_in_pixel);
+ NativeMetafile::kTopMarginInInch * dpi),
+ page_width_in_pixel -
+ (NativeMetafile::kLeftMarginInInch +
+ NativeMetafile::kRightMarginInInch) * dpi,
+ page_height_in_pixel -
+ (NativeMetafile::kTopMarginInInch +
+ NativeMetafile::kBottomMarginInInch) * dpi);
}
print_settings->set_dpi(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