texlive[44964] Build/source/texk/web2c/xetexdir:

commits+kakuto at tug.org commits+kakuto at tug.org
Sun Aug 6 09:12:03 CEST 2017


Revision: 44964
          http://tug.org/svn/texlive?view=revision&revision=44964
Author:   kakuto
Date:     2017-08-06 09:12:02 +0200 (Sun, 06 Aug 2017)
Log Message:
-----------
xetexdir/pdfimage.cpp: : Support /Rotate in PDF inclusion.

Modified Paths:
--------------
    trunk/Build/source/texk/web2c/xetexdir/ChangeLog
    trunk/Build/source/texk/web2c/xetexdir/pdfimage.cpp

Modified: trunk/Build/source/texk/web2c/xetexdir/ChangeLog
===================================================================
--- trunk/Build/source/texk/web2c/xetexdir/ChangeLog	2017-08-06 07:02:46 UTC (rev 44963)
+++ trunk/Build/source/texk/web2c/xetexdir/ChangeLog	2017-08-06 07:12:02 UTC (rev 44964)
@@ -1,3 +1,8 @@
+2017-03-17  Akira Kakuto  <kakuto at fuk.kindai.ac.jp>
+
+	* pdfimage.cpp: Support /Rotate in PDF image inclusion with
+	the new xdvipdfmx-20170806.
+
 2017-07-17  Jonathan Kew  <jfkthame at gmail.com>
 
 	* xetex.ch: Set a non-zero exit code if the pipe

Modified: trunk/Build/source/texk/web2c/xetexdir/pdfimage.cpp
===================================================================
--- trunk/Build/source/texk/web2c/xetexdir/pdfimage.cpp	2017-08-06 07:02:46 UTC (rev 44963)
+++ trunk/Build/source/texk/web2c/xetexdir/pdfimage.cpp	2017-08-06 07:12:02 UTC (rev 44964)
@@ -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 @@
 			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);



More information about the tex-live-commits mailing list