Chromium Code Reviews| 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); |