]> git.vpit.fr Git - perl/modules/LaTeX-TikZ.git/blobdiff - lib/LaTeX/TikZ/Point.pm
First cut at the documentation
[perl/modules/LaTeX-TikZ.git] / lib / LaTeX / TikZ / Point.pm
index 3c2446915862b778d360e4530ad29281022b9df6..7fa3fa1076b0a61a8689284df875aaea90856c32 100644 (file)
@@ -24,12 +24,26 @@ use Any::Moose 'Util::TypeConstraints' => [ qw/
  register_type_constraint
 / ];
 
+=head1 ATTRIBUTES
+
+=head2 C<x>
+
+The abscissa of the point.
+
+=cut
+
 has 'x' => (
  is       => 'ro',
  isa      => 'Num',
  required => 1,
 );
 
+=head2 C<y>
+
+The ordinate of the point.
+
+=cut
+
 has 'y' => (
  is       => 'ro',
  isa      => 'Num',
@@ -49,6 +63,14 @@ 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 AUTHOR