+ join $;, map {
+ defined() ? "$_" : '(undef)';
+ } map($tikz->$_, qw/unit format scale width height/), $origin;
+}
+
+my $find_mods = do {
+ our %seen;
+
+ my $find_mods_rec;
+ $find_mods_rec = do {
+ no warnings 'recursion';
+
+ Sub::Name::subname('find_mods_rec' => sub {
+ my ($set, $layers, $others) = @_;
+
+ for ($set->mods) {
+ my $tag = $_->tag;
+ next if $seen{$tag}++;
+
+ if ($_->isa('LaTeX::TikZ::Mod::Layer')) {
+ push @$layers, $_;
+ } else {
+ push @$others, $_;
+ }