summaryrefslogtreecommitdiff
path: root/Build/source
diff options
context:
space:
mode:
authorAkira Kakuto <kakuto@fuk.kindai.ac.jp>2017-08-06 07:12:02 +0000
committerAkira Kakuto <kakuto@fuk.kindai.ac.jp>2017-08-06 07:12:02 +0000
commit51fb659674f3b6f8a1f5944e73b4fb9fdf90a14c (patch)
tree4eeed5281f12c0940183e7057646452ff8452832 /Build/source
parent0866741b109fde4a874b71685f92220fad324270 (diff)
xetexdir/pdfimage.cpp: : Support /Rotate in PDF inclusion.
git-svn-id: svn://tug.org/texlive/trunk@44964 c570f23f-e606-0410-a88d-b1316a301751
Diffstat (limited to 'Build/source')
-rw-r--r--Build/source/texk/web2c/xetexdir/ChangeLog5
-rw-r--r--Build/source/texk/web2c/xetexdir/pdfimage.cpp24
2 files changed, 28 insertions, 1 deletions
diff --git a/Build/source/texk/web2c/xetexdir/ChangeLog b/Build/source/texk/web2c/xetexdir/ChangeLog
index 18c4be0866d..668f746f51a 100644
--- a/Build/source/texk/web2c/xetexdir/ChangeLog
+++ b/Build/source/texk/web2c/xetexdir/ChangeLog
@@ -1,3 +1,8 @@
+2017-03-17 Akira Kakuto <kakuto@fuk.kindai.ac.jp>
+
+ * pdfimage.cpp: Support /Rotate in PDF image inclusion with
+ the new xdvipdfmx-20170806.
+
2017-07-17 Jonathan Kew <jfkthame@gmail.com>
* xetex.ch: Set a non-zero exit code if the pipe
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);