diff --git a/CHANGELOG.TXT b/CHANGELOG.TXT index ddfff06..5dd0624 100644 --- a/CHANGELOG.TXT +++ b/CHANGELOG.TXT @@ -1,3 +1,6 @@ +6.0.059 (2014-02-03) + - SVG 'use' support was imporved. + 6.0.058 (2014-01-31) - Bug #886 "Bugs with SVG using and " was fixed. diff --git a/README.TXT b/README.TXT index 07cbc6c..d55bbe7 100644 --- a/README.TXT +++ b/README.TXT @@ -8,8 +8,8 @@ http://sourceforge.net/donate/index.php?group_id=128076 ------------------------------------------------------------ Name: TCPDF -Version: 6.0.058 -Release date: 2014-01-31 +Version: 6.0.059 +Release date: 2014-02-03 Author: Nicola Asuni Copyright (c) 2002-2014: diff --git a/composer.json b/composer.json index cdc4d48..c653067 100644 --- a/composer.json +++ b/composer.json @@ -1,6 +1,6 @@ { "name": "tecnick.com/tcpdf", - "version": "6.0.058", + "version": "6.0.059", "homepage": "http://www.tcpdf.org/", "type": "library", "description": "TCPDF is a PHP class for generating PDF documents.", diff --git a/include/tcpdf_static.php b/include/tcpdf_static.php index 8176fc7..f6c41df 100644 --- a/include/tcpdf_static.php +++ b/include/tcpdf_static.php @@ -55,7 +55,7 @@ class TCPDF_STATIC { * Current TCPDF version. * @private static */ - private static $tcpdf_version = '6.0.058'; + private static $tcpdf_version = '6.0.059'; /** * String alias for total number of pages. diff --git a/tcpdf.php b/tcpdf.php index 090ec0d..2092f75 100644 --- a/tcpdf.php +++ b/tcpdf.php @@ -1,9 +1,9 @@ * @package com.tecnick.tcpdf * @author Nicola Asuni - * @version 6.0.058 + * @version 6.0.059 */ // TCPDF configuration @@ -128,7 +128,7 @@ require_once(dirname(__FILE__).'/include/tcpdf_static.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 6.0.058 + * @version 6.0.059 * @author Nicola Asuni - info@tecnick.com */ class TCPDF { @@ -23632,7 +23632,7 @@ Putting 1 is equivalent to putting 0 and calling Ln() just after. Default value: if (end($this->svgdefs) !== FALSE) { $last_svgdefs_id = key($this->svgdefs); if (isset($this->svgdefs[$last_svgdefs_id]['attribs']['child_elements'])) { - $attribs['id'] = 'DF_'.(count($this->svgdefs) + 1); + $attribs['id'] = 'DF_'.(count($this->svgdefs[$last_svgdefs_id]['attribs']['child_elements']) + 1); $this->svgdefs[$last_svgdefs_id]['attribs']['child_elements'][$attribs['id']] = array('name' => $name, 'attribs' => $attribs); return; } @@ -23651,7 +23651,7 @@ Putting 1 is equivalent to putting 0 and calling Ln() just after. Default value: // default fill attribute for clipping $attribs['fill'] = 'none'; } - if (isset($attribs['style']) AND !TCPDF_STATIC::empty_string($attribs['style'])) { + if (isset($attribs['style']) AND !TCPDF_STATIC::empty_string($attribs['style']) AND ($attribs['style'][0] != ';')) { // fix style for regular expression $attribs['style'] = ';'.$attribs['style']; } @@ -23722,6 +23722,11 @@ Putting 1 is equivalent to putting 0 and calling Ln() just after. Default value: // group together related graphics elements array_push($this->svgstyles, $svgstyle); $this->StartTransform(); + $x = (isset($attribs['x'])?$attribs['x']:0); + $y = (isset($attribs['y'])?$attribs['y']:0); + $w = (isset($attribs['width'])?$attribs['width']:1); + $h = (isset($attribs['height'])?$attribs['height']:1); + $tm = TCPDF_STATIC::getTransformationMatrixProduct($tm, array($w, 0, 0, $h, $x, $y)); $this->SVGTransform($tm); $this->setSVGStyles($svgstyle, $prev_svgstyle); break; @@ -24134,6 +24139,13 @@ Putting 1 is equivalent to putting 0 and calling Ln() just after. Default value: if (isset($use['attribs']['y']) AND isset($attribs['y'])) { $attribs['y'] += $use['attribs']['y']; } + if (empty($attribs['style'])) { + $attribs['style'] = ''; + } + if (!empty($use['attribs']['style'])) { + // merge styles + $attribs['style'] = str_replace(';;',';',';'.$use['attribs']['style'].$attribs['style']); + } $attribs = array_merge($use['attribs'], $attribs); $this->startSVGElementHandler('use-tag', $use['name'], $attribs); return;