isa => 'LaTeX::TikZ::Point::Autocoerce',
required => 1,
coerce => 1,
+ handles => [ qw/x y/ ],
);
coerce 'LaTeX::TikZ::Set::Point'
=> from 'Any'
=> via { __PACKAGE__->new(point => $_) };
+coerce 'LaTeX::TikZ::Point::Autocoerce'
+ => from 'LaTeX::TikZ::Set::Point'
+ => via { $_->point };
+
sub path {
my ($set, $tikz) = @_;
use LaTeX::TikZ::Interface point => sub {
shift;
- __PACKAGE__->new(point => @_ > 1 ? \@_ : $_[0] );
+ my $point = @_ == 0 ? 0
+ : @_ == 1 ? $_[0]
+ : \@_;
+ __PACKAGE__->new(point => $point);
};
__PACKAGE__->meta->make_immutable;