aboutsummaryrefslogtreecommitdiff
path: root/src/MTools/Anim
diff options
context:
space:
mode:
authormarion2009-02-27 09:46:25 +0000
committermarion2009-02-27 09:46:25 +0000
commitedcfd2df9da29ec26f13a7b481be6a528b850ba4 (patch)
tree9674519699865a44db0cc3b26f7685d34a7cbef9 /src/MTools/Anim
parent0dc4132db1a4acc83869bbdbc420d9b027248881 (diff)
downloadmtc-edcfd2df9da29ec26f13a7b481be6a528b850ba4.zip
mtc-edcfd2df9da29ec26f13a7b481be6a528b850ba4.tar.gz
mtc-edcfd2df9da29ec26f13a7b481be6a528b850ba4.tar.bz2
mtc-edcfd2df9da29ec26f13a7b481be6a528b850ba4.tar.xz
ajout de la méthode complete pour MScalor et MPath
Diffstat (limited to 'src/MTools/Anim')
-rw-r--r--src/MTools/Anim/MPath.pm7
-rw-r--r--src/MTools/Anim/MScalor.pm8
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');