summaryrefslogtreecommitdiffstats
path: root/printing/print_settings_initializer_gtk.cc
diff options
context:
space:
mode:
authorhamaji@chromium.org <hamaji@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2010-11-10 06:10:51 +0000
committerhamaji@chromium.org <hamaji@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2010-11-10 06:10:51 +0000
commit24281f8d4707ce04f9987f7a2af2cdb4ff973292 (patch)
tree60215ce6f47ab770cf45013d2dc2e31b0bb78b8d /printing/print_settings_initializer_gtk.cc
parentc8c262b4dad5473c7563dc4e8d9cb69f117682ef (diff)
downloadchromium_src-24281f8d4707ce04f9987f7a2af2cdb4ff973292.zip
chromium_src-24281f8d4707ce04f9987f7a2af2cdb4ff973292.tar.gz
chromium_src-24281f8d4707ce04f9987f7a2af2cdb4ff973292.tar.bz2
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
Diffstat (limited to 'printing/print_settings_initializer_gtk.cc')
-rw-r--r--printing/print_settings_initializer_gtk.cc12
1 files changed, 8 insertions, 4 deletions
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<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);