pajoye          Wed Mar 18 08:15:27 2009 UTC

  Modified files:              (Branch: PHP_5_2)
    /php-src/ext/gd/libgd       gdft.c 
    /php-src    NEWS 
  Log:
  - #43073, TrueType bounding box is wrong for angle<>0
  
http://cvs.php.net/viewvc.cgi/php-src/ext/gd/libgd/gdft.c?r1=1.36.4.10&r2=1.36.4.11&diff_format=u
Index: php-src/ext/gd/libgd/gdft.c
diff -u php-src/ext/gd/libgd/gdft.c:1.36.4.10 
php-src/ext/gd/libgd/gdft.c:1.36.4.11
--- php-src/ext/gd/libgd/gdft.c:1.36.4.10       Wed Jan  9 01:50:59 2008
+++ php-src/ext/gd/libgd/gdft.c Wed Mar 18 08:15:27 2009
@@ -1108,15 +1108,23 @@
                double d1 = sin (angle + 0.78539816339744830962);
                double d2 = sin (angle - 0.78539816339744830962);
 
+               /* make the center of rotation at (0, 0) */
+               FT_BBox normbox;
+
+               normbox.xMin = 0;
+               normbox.yMin = 0;
+               normbox.xMax = bbox.xMax - bbox.xMin;
+               normbox.yMax = bbox.yMax - bbox.yMin;
+
                /* rotate bounding rectangle */
-               brect[0] = (int) (bbox.xMin * cos_a - bbox.yMin * sin_a);
-               brect[1] = (int) (bbox.xMin * sin_a + bbox.yMin * cos_a);
-               brect[2] = (int) (bbox.xMax * cos_a - bbox.yMin * sin_a);
-               brect[3] = (int) (bbox.xMax * sin_a + bbox.yMin * cos_a);
-               brect[4] = (int) (bbox.xMax * cos_a - bbox.yMax * sin_a);
-               brect[5] = (int) (bbox.xMax * sin_a + bbox.yMax * cos_a);
-               brect[6] = (int) (bbox.xMin * cos_a - bbox.yMax * sin_a);
-               brect[7] = (int) (bbox.xMin * sin_a + bbox.yMax * cos_a);
+               brect[0] = (int) (normbox.xMin * cos_a - normbox.yMin * sin_a);
+               brect[1] = (int) (normbox.xMin * sin_a + normbox.yMin * cos_a);
+               brect[2] = (int) (normbox.xMax * cos_a - normbox.yMin * sin_a);
+               brect[3] = (int) (normbox.xMax * sin_a + normbox.yMin * cos_a);
+               brect[4] = (int) (normbox.xMax * cos_a - normbox.yMax * sin_a);
+               brect[5] = (int) (normbox.xMax * sin_a + normbox.yMax * cos_a);
+               brect[6] = (int) (normbox.xMin * cos_a - normbox.yMax * sin_a);
+               brect[7] = (int) (normbox.xMin * sin_a + normbox.yMax * cos_a);
 
                /* scale, round and offset brect */
                brect[0] = x + gdroundupdown(brect[0], d2 > 0);
http://cvs.php.net/viewvc.cgi/php-src/NEWS?r1=1.2027.2.547.2.1442&r2=1.2027.2.547.2.1443&diff_format=u
Index: php-src/NEWS
diff -u php-src/NEWS:1.2027.2.547.2.1442 php-src/NEWS:1.2027.2.547.2.1443
--- php-src/NEWS:1.2027.2.547.2.1442    Tue Mar 17 22:04:56 2009
+++ php-src/NEWS        Wed Mar 18 08:15:27 2009
@@ -22,6 +22,7 @@
   bit numbers). (Matt)
 - Fixed bug #45799 (imagepng() crashes on empty image). (Martin McNickle,
   Takeshi Abe)
+- Fixed bug #43073, (TrueType bounding box is wrong for angle<>0) (Martin 
McNickle)
 
 26 Feb 2009, PHP 5.2.9
 - Changed __call() to be invoked on private/protected method access, similar to



-- 
PHP CVS Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php

Reply via email to