=head1 VERSION
-Version 0.01
+Version 0.02
=cut
-our $VERSION = '0.01';
+our $VERSION = '0.02';
-use Carp;
+use Carp ();
use LaTeX::TikZ::Point;
use LaTeX::TikZ::Set::Line;
-use Any::Moose 'Util::TypeConstraints' => [ 'find_type_constraint' ];
+use LaTeX::TikZ::Interface;
+
+use Mouse::Util::TypeConstraints 'find_type_constraint';
my $ltp_tc = find_type_constraint('LaTeX::TikZ::Point::Autocoerce');
-use LaTeX::TikZ::Interface arrow => sub {
- shift;
+LaTeX::TikZ::Interface->register(
+ arrow => sub {
+ shift;
+
+ Carp::confess('Not enough arguments') unless @_ >= 2;
+
+ my $from = $ltp_tc->coerce(shift);
- Carp::confess('Not enough arguments') unless @_ >= 2;
+ my $to;
+ if ($_[0] eq 'dir') {
+ my $dir = $ltp_tc->coerce($_[1]);
+ $to = LaTeX::TikZ::Point->new(
+ x => $from->x + $dir->x,
+ y => $from->y + $dir->y,
+ );
+ } else {
+ $to = $_[0];
+ }
- my $from = $ltp_tc->coerce(shift);
+ LaTeX::TikZ::Set::Line->new(
+ from => $from,
+ to => $to,
+ )->mod('->');
+ },
+);
- my $to;
- if ($_[0] eq 'dir') {
- my $dir = $ltp_tc->coerce($_[1]);
- $to = LaTeX::TikZ::Point->new(
- x => $from->x + $dir->x,
- y => $from->y + $dir->y,
- );
- } else {
- $to = $_[0];
- }
+=head1 SEE ALSO
- LaTeX::TikZ::Set::Line->new(
- from => $from,
- to => $to,
- )->mod('->');
-};
+L<LaTeX::TikZ>, L<LaTeX::TikZ::Set>.
=head1 AUTHOR
=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.