X-Git-Url: http://git.vpit.fr/?a=blobdiff_plain;f=lib%2FLaTeX%2FTikZ%2FSet.pm;h=4e6eafcab46dc282645010805e07fb4f03734b57;hb=615913e4089427f90d33b25bd69534e202ae31ef;hp=5a8882166c145125f092d157f6dc6b2c6c3b2614;hpb=09672e9c20f667050359f33e3ac4ac9c923a3132;p=perl%2Fmodules%2FLaTeX-TikZ.git diff --git a/lib/LaTeX/TikZ/Set.pm b/lib/LaTeX/TikZ/Set.pm index 5a88821..4e6eafc 100644 --- a/lib/LaTeX/TikZ/Set.pm +++ b/lib/LaTeX/TikZ/Set.pm @@ -9,11 +9,11 @@ LaTeX::TikZ::Set - Base role for LaTeX::TikZ set objects. =head1 VERSION -Version 0.01 +Version 0.02 =cut -our $VERSION = '0.01'; +our $VERSION = '0.02'; use Scope::Guard (); @@ -57,9 +57,9 @@ Returns an array reference of TikZ code lines required to effectively draw the c =cut -requires qw( +requires qw< draw -); +>; =head2 C @@ -111,7 +111,7 @@ MOD: my $tag = $mod->tag; my $old = $mods{$tag} || []; for (@$old) { - next MOD if $_->[0]->cover($mod); + next MOD if $_->[0]->covers($mod); } push @{$mods{$tag}}, [ $mod, $last_mod++, $is_layer ]; push @mods, $mod; @@ -148,11 +148,12 @@ This is a shortcut for C<< $set->mod(Tikz->layer($layer)) >>. =cut sub layer { - return $_[0] unless @_ > 1; + my $set = shift; - my $layer = $_[1]; + return $set unless @_; - $_[0]->mod( + my $layer = $_[0]; + $set->mod( $ltml_tc->check($layer) ? $layer : LaTeX::TikZ::Mod::Layer->new(name => $layer) ) @@ -166,12 +167,14 @@ This is a shortcut for C<< $set->mod(Tikz->clip($path)) >>. =cut sub clip { - return $_[0] unless @_ > 1; + my $set = shift; + + return $set unless @_; - $_[0]->mod( + $set->mod( map { $ltmc_tc->check($_) ? $_ : LaTeX::TikZ::Mod::Clip->new(clip => $_) - } @_[1 .. $#_] + } @_ ) }