diff options
author | marion | 2009-03-09 09:52:03 +0000 |
---|---|---|
committer | marion | 2009-03-09 09:52:03 +0000 |
commit | b488bfc01282d3dd3b71b29d5b971cf6a0b184fb (patch) | |
tree | 924f0f4e6df917f0bffed62cd0aa21aeecb13d71 | |
parent | f6848427a2b7afa79cf9ae8e1b8e96540545db5d (diff) | |
download | mtc-b488bfc01282d3dd3b71b29d5b971cf6a0b184fb.zip mtc-b488bfc01282d3dd3b71b29d5b971cf6a0b184fb.tar.gz mtc-b488bfc01282d3dd3b71b29d5b971cf6a0b184fb.tar.bz2 mtc-b488bfc01282d3dd3b71b29d5b971cf6a0b184fb.tar.xz |
correction de la méthode complete des animations
-rw-r--r-- | src/MTools/Anim/MOpacity.pm | 9 | ||||
-rw-r--r-- | src/MTools/Anim/MScalor.pm | 9 | ||||
-rw-r--r-- | src/MTools/Anim/MTranslator.pm | 9 |
3 files changed, 24 insertions, 3 deletions
diff --git a/src/MTools/Anim/MOpacity.pm b/src/MTools/Anim/MOpacity.pm index 4525b2d..382a505 100644 --- a/src/MTools/Anim/MOpacity.pm +++ b/src/MTools/Anim/MOpacity.pm @@ -77,6 +77,7 @@ sub new { }); $self -> {__animation} = undef; $self -> mconfigure (%options); + $self -> {__complete} = 0; return $self; } @@ -102,7 +103,12 @@ sub start { }); $self -> {__animation} -> wheninterrupted (sub { $self -> {__animation} = undef; - $self -> notify ('ANIMATION_ABORD', $self -> {__opacity}); + if ($self -> {__complete}) { + $self -> {__complete} = 0; + $self -> notify ('ANIMATION_END'); + } else { + $self -> notify ('ANIMATION_ABORD', $self -> {__opacity}); + } }); $self -> {__animation} -> start (); } @@ -119,6 +125,7 @@ sub complete { my ($self) = @_; return if !$self->isRunning(); $self->__event($self -> mget ('to_opacity') - $self -> {__opacitydep}); + $self -> {__complete} = 1; $self->stop(); } diff --git a/src/MTools/Anim/MScalor.pm b/src/MTools/Anim/MScalor.pm index da1914d..5d84e8e 100644 --- a/src/MTools/Anim/MScalor.pm +++ b/src/MTools/Anim/MScalor.pm @@ -81,6 +81,7 @@ sub new { }); $self -> {__animation} = undef; $self -> mconfigure (%options); + $self -> {__complete} = 0; return $self; } @@ -109,7 +110,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 (); } @@ -126,6 +132,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(); } 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 (); } |