X-Git-Url: http://git.vpit.fr/?a=blobdiff_plain;f=lib%2FLaTeX%2FTikZ%2FSet%2FSequence.pm;h=ce4a7adadab1cb5ca547f851f50d82edf07d80f2;hb=062ab95259610ce39ace60365b659d6113420ce7;hp=dfb30f73e19799542d05091a9847d11adbc34b79;hpb=f54cadb836315572aa2c4bcb16f221da1687df7a;p=perl%2Fmodules%2FLaTeX-TikZ.git diff --git a/lib/LaTeX/TikZ/Set/Sequence.pm b/lib/LaTeX/TikZ/Set/Sequence.pm index dfb30f7..ce4a7ad 100644 --- a/lib/LaTeX/TikZ/Set/Sequence.pm +++ b/lib/LaTeX/TikZ/Set/Sequence.pm @@ -22,25 +22,24 @@ use LaTeX::TikZ::Scope; use LaTeX::TikZ::Interface; use LaTeX::TikZ::Functor; -use Any::Moose; -use Any::Moose 'Util::TypeConstraints' - => [ qw/subtype as where find_type_constraint/ ]; +use Mouse; +use Mouse::Util::TypeConstraints qw; =head1 RELATIONSHIPS -This class consumes the L and L roles, and as such implements the L and L methods. +This class consumes the L and L roles, and as such implements the L, L and L methods. =cut -with qw( +with qw< LaTeX::TikZ::Set - LaTeX::TikZ::Set::Mutable -); + LaTeX::TikZ::Set::Container +>; subtype 'LaTeX::TikZ::Set::Sequence::Elements' => as 'Object' => where { - $_->does('LaTeX::TikZ::Set::Op') + $_->does('LaTeX::TikZ::Set::Path') or $_->isa('LaTeX::TikZ::Set::Sequence') }; @@ -48,7 +47,7 @@ subtype 'LaTeX::TikZ::Set::Sequence::Elements' =head2 C -The L or L objects that from the sequence. +The L or L objects that from the sequence. =cut @@ -86,9 +85,12 @@ sub add { sub draw { my $set = shift; + my @kids = $set->kids; + return [ ] unless @kids; + List::Util::reduce { LaTeX::TikZ::Scope::fold($a, $b) } map $_->draw(@_), - $set->kids; + @kids; } LaTeX::TikZ::Interface->register( @@ -110,7 +112,7 @@ __PACKAGE__->meta->make_immutable; =head1 SEE ALSO -L, L, L. +L, L, L. =head1 AUTHOR @@ -131,7 +133,7 @@ You can find documentation for this module with the perldoc command. =head1 COPYRIGHT & LICENSE -Copyright 2010 Vincent Pit, all rights reserved. +Copyright 2010,2011,2012,2013,2014,2015 Vincent Pit, all rights reserved. This program is free software; you can redistribute it and/or modify it under the same terms as Perl itself.