X-Git-Url: http://git.vpit.fr/?a=blobdiff_plain;f=lib%2FLaTeX%2FTikZ%2FMod%2FPattern%2FLines.pm;h=90a53b1ad9db32dad85b79bb4e1bc478651e8417;hb=062ab95259610ce39ace60365b659d6113420ce7;hp=d38222c576f2b6e9980ff44deb26eb10ce47467c;hpb=d934d1a7f7268b248687f14e0ede2723010bf243;p=perl%2Fmodules%2FLaTeX-TikZ.git diff --git a/lib/LaTeX/TikZ/Mod/Pattern/Lines.pm b/lib/LaTeX/TikZ/Mod/Pattern/Lines.pm index d38222c..90a53b1 100644 --- a/lib/LaTeX/TikZ/Mod/Pattern/Lines.pm +++ b/lib/LaTeX/TikZ/Mod/Pattern/Lines.pm @@ -9,21 +9,33 @@ LaTeX::TikZ::Mod::Pattern::Lines - An hatched pattern modifier. =head1 VERSION -Version 0.01 +Version 0.02 =cut -our $VERSION = '0.01'; +our $VERSION = '0.02'; use Sub::Name (); use LaTeX::TikZ::Tools; -use Any::Moose; -use Any::Moose 'Util::TypeConstraints'; +use Mouse; +use Mouse::Util::TypeConstraints; + +=head1 RELATIONSHIPS + +This class inherits the L class and its L, L, L and L methods. + +=cut extends 'LaTeX::TikZ::Mod::Pattern'; +=head1 ATTRIBUTES + +=head2 C + +=cut + enum 'LaTeX::TikZ::Mod::Pattern::Direction' => ( 'horizontal', 'vertical', 'north east', 'north west', ); @@ -34,16 +46,24 @@ has 'direction' => ( default => 'horizontal', ); +=head2 C + +=cut + has 'line_width' => ( is => 'ro', - isa => 'Int', + isa => subtype('Num' => where { LaTeX::TikZ::Tools::numcmp($_, 0) >= 0 }), default => 1, ); +=head2 C + +=cut + has 'space_width' => ( is => 'ro', - isa => 'Int', - default => 1, + isa => subtype('Num' => where { LaTeX::TikZ::Tools::numcmp($_, 0) >= 0 }), + default => 10, ); my $W = Sub::Name::subname('WIDTH' => sub { sprintf '#WIDTH=%0.1f#', @_ }); @@ -105,7 +125,7 @@ around 'BUILDARGS' => sub { confess('Can\'t specify an explicit template for a '. __PACKAGE__ .' pattern') if exists $args{template}; - my @params = qw/direction line_width space_width/; + my @params = qw; my $meta = $class->meta; for (@params) { @@ -119,9 +139,19 @@ around 'BUILDARGS' => sub { $class->$orig(%args); }; +=head1 METHODS + +=head2 C + +=cut + sub tag { join '/', ref $_[0], $_[0]->direction } -sub cover { +=head2 C + +=cut + +sub covers { my ($this, $other) = @_; LaTeX::TikZ::Tools::numeq($this->line_width, $other->line_width) or return 0; @@ -133,6 +163,10 @@ sub cover { __PACKAGE__->meta->make_immutable; +=head1 SEE ALSO + +L, L. + =head1 AUTHOR Vincent Pit, C<< >>, L. @@ -152,7 +186,7 @@ You can find documentation for this module with the perldoc command. =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.