diff --git a/CHANGELOG.TXT b/CHANGELOG.TXT index 401c5c7..9270876 100755 --- a/CHANGELOG.TXT +++ b/CHANGELOG.TXT @@ -1,3 +1,6 @@ +5.9.147 (2012-02-14) + - A problem with SVG gradients has been fixed. + 5.9.146 (2012-02-12) - Bug item #3486880 "$filehash undefine error" was fixed. - The default font is now the one specified at PDF_FONT_NAME_MAIN constant. diff --git a/README.TXT b/README.TXT index a22d72b..7e0dd2c 100755 --- a/README.TXT +++ b/README.TXT @@ -8,8 +8,8 @@ http://sourceforge.net/donate/index.php?group_id=128076 ------------------------------------------------------------ Name: TCPDF -Version: 5.9.146 -Release date: 2012-02-12 +Version: 5.9.147 +Release date: 2012-02-14 Author: Nicola Asuni Copyright (c) 2002-2012: diff --git a/tcpdf.php b/tcpdf.php index a9dabac..6279437 100755 --- a/tcpdf.php +++ b/tcpdf.php @@ -1,9 +1,9 @@ * @package com.tecnick.tcpdf * @author Nicola Asuni - * @version 5.9.146 + * @version 5.9.147 */ // Main configuration file. Define the K_TCPDF_EXTERNAL_CONFIG constant to skip this file. @@ -149,7 +149,7 @@ require_once(dirname(__FILE__).'/config/tcpdf_config.php'); * TCPDF project (http://www.tcpdf.org) has been originally derived in 2002 from the Public Domain FPDF class by Olivier Plathey (http://www.fpdf.org), but now is almost entirely rewritten.
* @package com.tecnick.tcpdf * @brief PHP class for generating PDF documents without requiring external extensions. - * @version 5.9.146 + * @version 5.9.147 * @author Nicola Asuni - info@tecnick.com */ class TCPDF { @@ -160,7 +160,7 @@ class TCPDF { * Current TCPDF version. * @private */ - private $tcpdf_version = '5.9.146'; + private $tcpdf_version = '5.9.147'; // Protected properties @@ -27686,6 +27686,12 @@ Putting 1 is equivalent to putting 0 and calling Ln() just after. Default value: if (isset($gradient['coords'][4])) { $gradient['coords'][4] = $this->getHTMLUnitToUnits($gradient['coords'][4], 0, $this->svgunit, false); } + if ($w <= $minlen) { + $w = $minlen; + } + if ($h <= $minlen) { + $h = $minlen; + } // shift units if ($gradient['gradientUnits'] == 'objectBoundingBox') { // convert to SVG coordinate system @@ -27694,12 +27700,6 @@ Putting 1 is equivalent to putting 0 and calling Ln() just after. Default value: $gradient['coords'][2] += $x; $gradient['coords'][3] += $y; } - if ($w <= $minlen) { - $w = $minlen; - } - if ($h <= $minlen) { - $h = $minlen; - } // calculate percentages $gradient['coords'][0] = ($gradient['coords'][0] - $x) / $w; $gradient['coords'][1] = ($gradient['coords'][1] - $y) / $h; @@ -27711,14 +27711,11 @@ Putting 1 is equivalent to putting 0 and calling Ln() just after. Default value: } elseif ($gradient['mode'] == 'percentage') { foreach($gradient['coords'] as $key => $val) { $gradient['coords'][$key] = (intval($val) / 100); - } - } - // fix values - foreach($gradient['coords'] as $key => $val) { - if ($val < 0) { - $gradient['coords'][$key] = 0; - } elseif ($val > 1) { - $gradient['coords'][$key] = 1; + if ($val < 0) { + $gradient['coords'][$key] = 0; + } elseif ($val > 1) { + $gradient['coords'][$key] = 1; + } } } if (($gradient['type'] == 2) AND ($gradient['coords'][0] == $gradient['coords'][2]) AND ($gradient['coords'][1] == $gradient['coords'][3])) { @@ -27734,7 +27731,7 @@ Putting 1 is equivalent to putting 0 and calling Ln() just after. Default value: $gradient['coords'][3] = $tmp; // set transformation map for gradient if ($gradient['type'] == 3) { - // gradient is always circular + // circular gradient $cy = $this->h - $y - ($gradient['coords'][1] * ($w + $h)); $this->_out(sprintf('%.3F 0 0 %.3F %.3F %.3F cm', $w*$this->k, $w*$this->k, $x*$this->k, $cy*$this->k)); } else {