Skip to content

Commit 9af64c2

Browse files
committed
Better support for Use tag (#10)
1 parent 8e0fb52 commit 9af64c2

File tree

1 file changed

+9
-1
lines changed

1 file changed

+9
-1
lines changed

src/Svg/Tag/UseTag.php

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
/**
33
* @package php-svg-lib
44
* @link http://github.com/PhenX/php-svg-lib
5-
* @author Fabien Ménager <[email protected]>
5+
* @author Fabien M�nager <[email protected]>
66
* @license http://www.gnu.org/copyleft/lesser.html GNU Lesser General Public License
77
*/
88

@@ -41,6 +41,10 @@ protected function before($attributes)
4141
$link = $attributes["xlink:href"];
4242
$this->reference = $document->getDef($link);
4343

44+
if ($this->reference) {
45+
$this->reference->before($attributes);
46+
}
47+
4448
$surface = $document->getSurface();
4549
$surface->save();
4650

@@ -50,6 +54,10 @@ protected function before($attributes)
5054
protected function after() {
5155
parent::after();
5256

57+
if ($this->reference) {
58+
$this->reference->after();
59+
}
60+
5361
$this->getDocument()->getSurface()->restore();
5462
}
5563

0 commit comments

Comments
 (0)