]> git.vpit.fr Git - perl/modules/LaTeX-TikZ.git/blobdiff - lib/LaTeX/TikZ/Set/Point.pm
Introduce LaTeX::TikZ::Set::Polyline
[perl/modules/LaTeX-TikZ.git] / lib / LaTeX / TikZ / Set / Point.pm
index c4749fe66ab879f51aa426fc3b01b0201621950e..409db5f359db6e51fa6686f5a01b21ba8f65f06d 100644 (file)
@@ -18,16 +18,25 @@ our $VERSION = '0.01';
 use LaTeX::TikZ::Point;
 
 use Any::Moose;
+use Any::Moose 'Util::TypeConstraints';
 
 with 'LaTeX::TikZ::Set::Op';
 
 has 'point' => (
  is       => 'ro',
does     => 'LaTeX::TikZ::Point::Autocoerce',
isa      => 'LaTeX::TikZ::Point::Autocoerce',
  required => 1,
  coerce   => 1,
 );
 
+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) = @_;