X-Git-Url: http://git.vpit.fr/?a=blobdiff_plain;f=lib%2FLaTeX%2FTikZ%2FSet.pm;h=4e6eafcab46dc282645010805e07fb4f03734b57;hb=615913e4089427f90d33b25bd69534e202ae31ef;hp=505dfec1a823712e0ce06477ed39a186d4416a5c;hpb=e6c6fbca8df4f8df7bbce2eb98dd260ed51d9141;p=perl%2Fmodules%2FLaTeX-TikZ.git diff --git a/lib/LaTeX/TikZ/Set.pm b/lib/LaTeX/TikZ/Set.pm index 505dfec..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 (); @@ -49,15 +49,17 @@ This method is required by the interface : =item * -C +C + +Returns an array reference of TikZ code lines required to effectively draw the current set object, formatted by the L object C<$formatter>. =back =cut -requires qw( +requires qw< draw -); +>; =head2 C @@ -109,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; @@ -146,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) ) @@ -164,15 +167,21 @@ This is a shortcut for C<< $set->mod(Tikz->clip($path)) >>. =cut sub clip { - return $_[0] unless @_ > 1; + my $set = shift; - $_[0]->mod( + return $set unless @_; + + $set->mod( map { $ltmc_tc->check($_) ? $_ : LaTeX::TikZ::Mod::Clip->new(clip => $_) - } @_[1 .. $#_] + } @_ ) } +=head1 SEE ALSO + +L. + =head1 AUTHOR Vincent Pit, C<< >>, L.