From d1b7f73a8017a97183f5bb1ec11c84c6dca1cdd0 Mon Sep 17 00:00:00 2001 From: Dominique Dumont Date: Thu, 17 May 2012 20:36:45 +0200 Subject: [PATCH] max_steps is now required --- lib/SDLx/SlideShow/Any.pm | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/lib/SDLx/SlideShow/Any.pm b/lib/SDLx/SlideShow/Any.pm index fa80154..9134548 100644 --- a/lib/SDLx/SlideShow/Any.pm +++ b/lib/SDLx/SlideShow/Any.pm @@ -15,7 +15,7 @@ use Any::Moose; use Any::Moose '::Util::TypeConstraints' ; # use Any::Moose '::Meta::Attribute::Native::Trait::Array' ; -has max_steps => ( is => 'rw', isa => 'Int', default => 26 ); +has max_steps => ( is => 'rw', isa => 'Int', required => 1 ); # tick method will draw on this surface has surface => ( @@ -37,6 +37,7 @@ has image => ( # step = 0 -> idle # step > 0 and < max_steps -> transitioning +# internal has step => ( traits => ['Counter'], is => 'rw', @@ -61,11 +62,13 @@ sub busy { return 0 ; } +#internal sub progress { my ($self,$value) = @_; return int($self->step * $value / $self->max_steps ) ; } +#internal sub regress { my ($self,$value) = @_; return int(($self->max_steps - $self->step) * $value / $self->max_steps) ;