From edcfd2df9da29ec26f13a7b481be6a528b850ba4 Mon Sep 17 00:00:00 2001 From: marion Date: Fri, 27 Feb 2009 09:46:25 +0000 Subject: ajout de la méthode complete pour MScalor et MPath --- src/MTools/Anim/MPath.pm | 7 +++++++ src/MTools/Anim/MScalor.pm | 8 +++++++- 2 files changed, 14 insertions(+), 1 deletion(-) (limited to 'src') diff --git a/src/MTools/Anim/MPath.pm b/src/MTools/Anim/MPath.pm index f6213f7..57fd846 100644 --- a/src/MTools/Anim/MPath.pm +++ b/src/MTools/Anim/MPath.pm @@ -138,6 +138,13 @@ sub stop { } } +sub complete { + my ($self) = @_; + return if !$self->isRunning(); + $self->__event(100); + $self->stop(); +} + sub __getPoint { my ($self, $percentage) = @_; my @points = @{$self -> mget ('path')}; diff --git a/src/MTools/Anim/MScalor.pm b/src/MTools/Anim/MScalor.pm index 4845c54..da1914d 100644 --- a/src/MTools/Anim/MScalor.pm +++ b/src/MTools/Anim/MScalor.pm @@ -55,7 +55,6 @@ sub new { my ($class, %options) = @_; my $self = new MTools::MObjet (); bless $self, $class; - $self -> recordProperty ('-visible', 0); $self -> recordProperty ('center_x', 0); $self -> recordProperty ('center_y', 0); @@ -123,6 +122,13 @@ sub stop { } } +sub complete { + my ($self) = @_; + return if !$self->isRunning(); + $self->__event($self -> mget ('to_x') - $self -> {__xdep}, $self -> mget ('to_y') - $self -> {__ydep}); + $self->stop(); +} + sub __event { my ($self, $x, $y) = @_; my $cx = $self -> mget ('center_x'); -- cgit v1.1