From 24281f8d4707ce04f9987f7a2af2cdb4ff973292 Mon Sep 17 00:00:00 2001 From: "hamaji@chromium.org" Date: Wed, 10 Nov 2010 06:10:51 +0000 Subject: Fix DCHECK failure in page_setup.cc on Linux. I think this issue was introduced in http://codereview.chromium.org/3619002 We need to subtract margins from page size to calculate the size of printable areas. BUG=none TEST=none Review URL: http://codereview.chromium.org/4732002 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@65635 0039d316-1c4b-4281-b951-d872f2087c98 --- printing/print_settings_initializer_gtk.cc | 12 ++++++++---- 1 file changed, 8 insertions(+), 4 deletions(-) (limited to 'printing') diff --git a/printing/print_settings_initializer_gtk.cc b/printing/print_settings_initializer_gtk.cc index fd7a5fd..60ab530 100644 --- a/printing/print_settings_initializer_gtk.cc +++ b/printing/print_settings_initializer_gtk.cc @@ -62,11 +62,15 @@ void PrintSettingsInitializerGtk::InitPrintSettings( static_cast(page_height_in_pixel)); printable_area_device_units.SetRect( static_cast( - NativeMetafile::kLeftMarginInInch * printing::kPixelsPerInch), + NativeMetafile::kLeftMarginInInch * dpi), static_cast( - 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); -- cgit v1.1