diff options
Diffstat (limited to 'src/MTools/Anim/MTranslator.pm')
-rw-r--r-- | src/MTools/Anim/MTranslator.pm | 9 |
1 files changed, 8 insertions, 1 deletions
diff --git a/src/MTools/Anim/MTranslator.pm b/src/MTools/Anim/MTranslator.pm index 73877e4..afbed91 100644 --- a/src/MTools/Anim/MTranslator.pm +++ b/src/MTools/Anim/MTranslator.pm @@ -81,6 +81,7 @@ sub new { }); $self -> {__animation} = undef; $self -> mconfigure (%options); + $self -> {__complete} = 0; return $self; } @@ -96,6 +97,7 @@ sub complete { my ($self) = @_; return if !$self->isRunning(); $self->event($self -> mget ('to_x') - $self -> {__xdep}, $self -> mget ('to_y') - $self -> {__ydep}); + $self -> {__complete} = 1; $self->stop(); } @@ -125,7 +127,12 @@ sub start { }); $self -> {__animation} -> wheninterrupted (sub { $self -> {__animation} = undef; - $self -> notify ('ANIMATION_ABORD', $self -> {__x}, $self -> {__y}); + if ($self -> {__complete}) { + $self -> {__complete} = 0; + $self -> notify ('ANIMATION_END'); + } else { + $self -> notify ('ANIMATION_ABORD', $self -> {__x}, $self -> {__y}); + } }); $self -> {__animation} -> start (); } |