diff options
-rw-r--r-- | src/MTools/Anim/MPath.pm | 7 | ||||
-rw-r--r-- | src/MTools/Anim/MScalor.pm | 8 |
2 files changed, 14 insertions, 1 deletions
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'); |