]> git.vpit.fr Git - perl/modules/LaTeX-TikZ.git/blobdiff - lib/LaTeX/TikZ/Set/Point.pm
Make Set::Point delegates ->x and ->y to the underlying point
[perl/modules/LaTeX-TikZ.git] / lib / LaTeX / TikZ / Set / Point.pm
index 409db5f359db6e51fa6686f5a01b21ba8f65f06d..eee96b0fa55c97c0b98cc1994a2aed69f614169b 100644 (file)
@@ -27,6 +27,7 @@ has 'point' => (
  isa      => 'LaTeX::TikZ::Point::Autocoerce',
  required => 1,
  coerce   => 1,
+ handles  => [ qw/x y/ ],
 );
 
 coerce 'LaTeX::TikZ::Set::Point'
@@ -48,7 +49,10 @@ sub path {
 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;