]> git.vpit.fr Git - perl/modules/LaTeX-TikZ.git/blobdiff - lib/LaTeX/TikZ/Set/Circle.pm
Enforce the non-negativity of some attributes with anonymous types
[perl/modules/LaTeX-TikZ.git] / lib / LaTeX / TikZ / Set / Circle.pm
index 06a692aec4f8149a2ac3475b104083b406eb6889..8efdd9841155eb25a12275eac0522ab9a368bd49 100644 (file)
@@ -34,14 +34,9 @@ has 'center' => (
  coerce   => 1,
 );
 
-subtype 'LaTeX::TikZ::Set::Circle::Radius'
-     => as 'Num'
-     => where { LaTeX::TikZ::Tools::numcmp($_, 0) >= 1 }
-     => message { "$_ isn't a non-negative real number" };
-
 has 'radius' => (
  is       => 'ro',
- isa      => 'LaTeX::TikZ::Set::Circle::Radius',
+ isa      => subtype('Num' => where { LaTeX::TikZ::Tools::numcmp($_, 0) > 0 }),
  required => 1,
 );