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

Unified Diff: printing/pdf_metafile_cg_mac.cc

Issue 8585017: PrintPreview: Honor the print media page size and margin values. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Fix win and mac issues Created 8 years, 12 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
Index: printing/pdf_metafile_cg_mac.cc
diff --git a/printing/pdf_metafile_cg_mac.cc b/printing/pdf_metafile_cg_mac.cc
index 78c1110a8eb13f82b04034c21b6915ff4d156195..a4358e213ab592062668e06586bfa730dd6b8082 100644
--- a/printing/pdf_metafile_cg_mac.cc
+++ b/printing/pdf_metafile_cg_mac.cc
@@ -202,8 +202,8 @@ bool PdfMetafileCg::RenderPage(unsigned int page_number,
}
}
// Some PDFs have a non-zero origin. Need to take that into account.
- float x_offset = rect.origin.x - (source_rect.origin.x * scaling_factor);
- float y_offset = rect.origin.y - (source_rect.origin.y * scaling_factor);
+ float x_offset = source_rect.origin.x * scaling_factor;
vandebo (ex-Chrome) 2012/01/07 00:23:19 You changed the sign. These should be negative.
kmadhusu 2012/01/09 17:15:55 Done.
+ float y_offset = source_rect.origin.y * scaling_factor;
if (center_vertically) {
x_offset += (rect.size.width -
@@ -212,10 +212,6 @@ bool PdfMetafileCg::RenderPage(unsigned int page_number,
if (center_horizontally) {
y_offset += (rect.size.height -
(source_rect.size.height * scaling_factor))/2;
- } else {
- // Since 0 y begins at the bottom, we need to adjust so the output appears
- // nearer the top if we are not centering horizontally.
- y_offset += rect.size.height - (source_rect.size.height * scaling_factor);
vandebo (ex-Chrome) 2012/01/07 00:23:19 I think you still need this code.
kmadhusu 2012/01/09 17:15:55 This code is not required with the new changes.
}
CGContextSaveGState(context);
CGContextTranslateCTM(context, x_offset, y_offset);

Powered by Google App Engine
This is Rietveld 408576698