X-Git-Url: http://git.vpit.fr/?a=blobdiff_plain;f=lib%2FLaTeX%2FTikZ%2FPoint.pm;h=d5c5da0b743386fa67d2ca1c87fe9304b4c61ac2;hb=615913e4089427f90d33b25bd69534e202ae31ef;hp=3c2446915862b778d360e4530ad29281022b9df6;hpb=abde159aad84169c3dbf1aabd21c9d1bf81acf85;p=perl%2Fmodules%2FLaTeX-TikZ.git diff --git a/lib/LaTeX/TikZ/Point.pm b/lib/LaTeX/TikZ/Point.pm index 3c24469..d5c5da0 100644 --- a/lib/LaTeX/TikZ/Point.pm +++ b/lib/LaTeX/TikZ/Point.pm @@ -9,20 +9,28 @@ LaTeX::TikZ::Point - Internal representation of what LaTeX::TikZ consider as 2D =head1 VERSION -Version 0.01 +Version 0.02 =cut -our $VERSION = '0.01'; +our $VERSION = '0.02'; use Any::Moose; -use Any::Moose 'Util::TypeConstraints' => [ qw/ +use Any::Moose 'Util::TypeConstraints' => [ qw< coerce from via find_type_constraint register_type_constraint -/ ]; +> ]; + +=head1 ATTRIBUTES + +=head2 C + +The abscissa of the point. + +=cut has 'x' => ( is => 'ro', @@ -30,6 +38,12 @@ has 'x' => ( required => 1, ); +=head2 C + +The ordinate of the point. + +=cut + has 'y' => ( is => 'ro', isa => 'Num', @@ -49,8 +63,20 @@ coerce 'LaTeX::TikZ::Point::Autocoerce' => from 'LaTeX::TikZ::Point' => via { $_ }; +coerce 'LaTeX::TikZ::Point::Autocoerce' + => from 'Num' + => via { LaTeX::TikZ::Point->new(x => $_, y => 0) }; + +coerce 'LaTeX::TikZ::Point::Autocoerce' + => from 'ArrayRef' + => via { LaTeX::TikZ::Point->new(x => $_->[0], y => $_->[1]) }; + __PACKAGE__->meta->make_immutable; +=head1 SEE ALSO + +L. + =head1 AUTHOR Vincent Pit, C<< >>, L.