diff options
Diffstat (limited to 'fpdfsdk/fpdfview.cpp')
-rw-r--r-- | fpdfsdk/fpdfview.cpp | 18 |
1 files changed, 10 insertions, 8 deletions
diff --git a/fpdfsdk/fpdfview.cpp b/fpdfsdk/fpdfview.cpp index 956e6db671..c51ee90fe0 100644 --- a/fpdfsdk/fpdfview.cpp +++ b/fpdfsdk/fpdfview.cpp @@ -967,12 +967,6 @@ DLLEXPORT void STDCALL FPDF_RenderPageBitmapWithMatrix(FPDF_BITMAP bitmap, CFX_RetainPtr<CFX_DIBitmap> pBitmap(CFXBitmapFromFPDFBitmap(bitmap)); pDevice->Attach(pBitmap, !!(flags & FPDF_REVERSE_BYTE_ORDER), nullptr, false); - CFX_Matrix transform_matrix = pPage->GetPageMatrix(); - if (matrix) { - transform_matrix.Concat(CFX_Matrix(matrix->a, matrix->b, matrix->c, - matrix->d, matrix->e, matrix->f)); - } - CFX_FloatRect clipping_rect; if (clipping) { clipping_rect.left = clipping->left; @@ -980,8 +974,16 @@ DLLEXPORT void STDCALL FPDF_RenderPageBitmapWithMatrix(FPDF_BITMAP bitmap, clipping_rect.right = clipping->right; clipping_rect.top = clipping->top; } - RenderPageImpl(pContext, pPage, transform_matrix, clipping_rect.ToFxRect(), - flags, true, nullptr); + FX_RECT clip_rect = clipping_rect.ToFxRect(); + + CFX_Matrix transform_matrix = pPage->GetDisplayMatrix( + clip_rect.left, clip_rect.top, clip_rect.Width(), clip_rect.Height(), 0); + if (matrix) { + transform_matrix.Concat(CFX_Matrix(matrix->a, matrix->b, matrix->c, + matrix->d, matrix->e, matrix->f)); + } + RenderPageImpl(pContext, pPage, transform_matrix, clip_rect, flags, true, + nullptr); pPage->SetRenderContext(nullptr); } |