]> git.vpit.fr Git - perl/modules/LaTeX-TikZ.git/blobdiff - lib/LaTeX/TikZ/Mod/Pattern/Lines.pm
Enforce the non-negativity of some attributes with anonymous types
[perl/modules/LaTeX-TikZ.git] / lib / LaTeX / TikZ / Mod / Pattern / Lines.pm
index d38222c576f2b6e9980ff44deb26eb10ce47467c..a86844020ded2e165e087dea465d31adf8fe87f5 100644 (file)
@@ -36,13 +36,13 @@ has 'direction' => (
 
 has 'line_width' => (
  is      => 'ro',
- isa     => 'Int',
+ isa     => subtype('Num' => where { LaTeX::TikZ::Tools::numcmp($_, 0) >= 0 }),
  default => 1,
 );
 
 has 'space_width' => (
  is      => 'ro',
- isa     => 'Int',
+ isa     => subtype('Num' => where { LaTeX::TikZ::Tools::numcmp($_, 0) >= 0 }),
  default => 1,
 );