]> git.vpit.fr Git - perl/modules/LaTeX-TikZ.git/blobdiff - lib/LaTeX/TikZ/Set/Mod.pm
More $set->mod and mod covering tests
[perl/modules/LaTeX-TikZ.git] / lib / LaTeX / TikZ / Set / Mod.pm
index 8444fea9e9cda9cc95620e64864d849d99fd1f08..f759b0de3ac1d805050440788d756fe1c3225185 100644 (file)
@@ -69,7 +69,7 @@ sub add {
  } else {
   require LaTeX::TikZ::Set::Sequence;
   $set->_set(LaTeX::TikZ::Set::Sequence->new(
-   kids => $kid,
+   kids => [ $kid, @_ ],
   ));
  }
 
@@ -88,14 +88,10 @@ MOD:
   for my $mod ($set->mods) {
    $has_layer = 1 if $ltml_tc->check($mod);
    my $tag = $mod->tag;
-   my @candidates;
-   if (defined $tag) {
-    my $old     = $mods{$tag};
-    @candidates = $old ? map $_->[0], @$old : ();
-   } else {
-    @candidates = values %mods;
+   my $old = $mods{$tag} || [];
+   for (@$old) {
+    next MOD if $_->[0]->cover($mod);
    }
-   $_->cover($mod) and next MOD for @candidates;
    push @{$mods{$tag}}, [ $mod, $last_mod++ ];
    push @mods,          $mod;
   }