diff options
Diffstat (limited to 'Build/source/texk/web2c/xetexdir/pdfimage.cpp')
-rw-r--r-- | Build/source/texk/web2c/xetexdir/pdfimage.cpp | 24 |
1 files changed, 23 insertions, 1 deletions
diff --git a/Build/source/texk/web2c/xetexdir/pdfimage.cpp b/Build/source/texk/web2c/xetexdir/pdfimage.cpp index 8538913692c..fc3e3269340 100644 --- a/Build/source/texk/web2c/xetexdir/pdfimage.cpp +++ b/Build/source/texk/web2c/xetexdir/pdfimage.cpp @@ -1,7 +1,7 @@ /****************************************************************************\ Part of the XeTeX typesetting system Copyright (c) 1994-2008 by SIL International - Copyright (c) 2009, 2011 by Jonathan Kew + Copyright (c) 2009, 2017 by Jonathan Kew SIL Author(s): Jonathan Kew @@ -98,6 +98,28 @@ pdf_get_rect(char* filename, int page_num, int pdf_box, realrect* box) break; } + int RotAngle = 0; + RotAngle = (int)page->getRotate() % 360; + if (RotAngle < 0) + RotAngle += 360; + if (RotAngle == 90 || RotAngle == 270) { + double tmpvalue; + if (r->x1 > r->x2) { + tmpvalue = r->x1; + r->x1 = r->x2; + r->x2 = tmpvalue; + } + if (r->y1 > r->y2) { + tmpvalue = r->y1; + r->y1 = r->y2; + r->y2 = tmpvalue; + } + + tmpvalue = r->x2; + r->x2 = r->x1 + r->y2 - r->y1; + r->y2 = r->y1 + tmpvalue - r->x1; + } + box->x = 72.27 / 72 * my_fmin(r->x1, r->x2); box->y = 72.27 / 72 * my_fmin(r->y1, r->y2); box->wd = 72.27 / 72 * fabs(r->x2 - r->x1); |