X-Git-Url: http://git.vpit.fr/?a=blobdiff_plain;f=lib%2FLaTeX%2FTikZ%2FFormatter.pm;h=da0656c288fbe4bf358bc4e6066d6b4ca8cc98eb;hb=cb3b916e0590c6a0b70b60f30304921385462faa;hp=64266072622b8dac002b407a7c57fa534e13e358;hpb=93bfe14caec156fc11587863a486220b986b6b2e;p=perl%2Fmodules%2FLaTeX-TikZ.git diff --git a/lib/LaTeX/TikZ/Formatter.pm b/lib/LaTeX/TikZ/Formatter.pm index 6426607..da0656c 100644 --- a/lib/LaTeX/TikZ/Formatter.pm +++ b/lib/LaTeX/TikZ/Formatter.pm @@ -62,13 +62,11 @@ $find_mods = do { Sub::Name::subname('find_mods' => sub { my ($set, $layers, $others) = @_; - if ($set->isa('LaTeX::TikZ::Set::Mod')) { - for ($set->mods) { - if ($_->isa('LaTeX::TikZ::Mod::Layer')) { - push @$layers, $_; - } else { - push @$others, $_; - } + for ($set->mods) { + if ($_->isa('LaTeX::TikZ::Mod::Layer')) { + push @$layers, $_; + } else { + push @$others, $_; } } @@ -111,16 +109,12 @@ sub render { ); my @decls; - if (@layers) { - push @decls, LaTeX::TikZ::Mod::Layer->declare(@layers); - } - for (@other_mods) { - push @decls, $_->declare($tikz); - } + push @decls, LaTeX::TikZ::Mod::Layer->declare(@layers) if @layers; + push @decls, $_->declare($tikz) for @other_mods; my @content = ( "\\begin{tikzpicture}", - $seq->draw($tikz)->instantiate, + @{ $seq->draw($tikz) }, "\\end{tikzpicture}", );