my $cache = $scope->_mods_cache;
for (@_) {
- my $mod = $ltmf_tc->check($_) ? $_ : $ltmf_tc->coerce($_);
+ my $mod = $ltmf_tc->coerce($_);
+ $ltmf_tc->assert_valid($mod);
my $tag = $mod->tag;
next if exists $cache->{$tag};
$cache->{$tag} = $mod;
sub mod {
my $set = shift;
- $ltm_tc->assert_valid($_) for @_;
+ my @mods = map $ltm_tc->coerce($_), @_;
+ $ltm_tc->assert_valid($_) for @mods;
- push @{$set->_mods}, @_;
+ push @{$set->_mods}, @mods;
$set;
}
for ($a, $b, $c) {
my $p = $ltp_tc->coerce($_);
+ $ltp_tc->assert_valid($p);
$_ = Math::Complex->make($p->x, $p->y);
}
MSG
$args{from} = $tc1->coerce($args{from});
$meta->find_attribute_by_name($_)->type_constraint->assert_valid($args{$_})
- for qw/width height/;
+ for qw/from width height/;
my $p = $args{from}->point;
$args{to} = LaTeX::TikZ::Point->new(
x => $p->x + $args{width},