summaryrefslogtreecommitdiff
path: root/src/utilities/animatedValue.vala
diff options
context:
space:
mode:
authorAlessandro Ghedini <al3xbio@gmail.com>2012-01-21 19:14:06 +0100
committerAlessandro Ghedini <al3xbio@gmail.com>2012-01-21 19:19:46 +0100
commitc05883f47c498be4e11893e5178c5bc37ffd9f4a (patch)
treedbd3cd7ad3d7771405ad63af2f1e9d14d4ae5a35 /src/utilities/animatedValue.vala
parent31539042f11bc210a29e923f45586779c3ad46b2 (diff)
parent60560a030fda3c539ff9dc1563b9926414a193da (diff)
Merge commit 'upstream/0.4.0'
Diffstat (limited to 'src/utilities/animatedValue.vala')
-rw-r--r--src/utilities/animatedValue.vala13
1 files changed, 10 insertions, 3 deletions
diff --git a/src/utilities/animatedValue.vala b/src/utilities/animatedValue.vala
index 32ab889..7acc7a7 100644
--- a/src/utilities/animatedValue.vala
+++ b/src/utilities/animatedValue.vala
@@ -116,10 +116,16 @@ public class AnimatedValue : GLib.Object {
/////////////////////////////////////////////////////////////////////
public void reset_target(double end, double duration) {
- this.start = this.val;
this.end = end;
this.duration = duration;
- this.state = 0.0;
+ this.start = this.val;
+
+ if (duration == 0.0) {
+ this.val = end;
+ this.state = 1.0;
+ } else {
+ this.state = 0.0;
+ }
}
/////////////////////////////////////////////////////////////////////
@@ -129,7 +135,7 @@ public class AnimatedValue : GLib.Object {
public void update(double time) {
this.state += time/this.duration;
- if (state < 1) {
+ if (this.state < 1) {
switch (this.type) {
case Type.LINEAR:
@@ -152,6 +158,7 @@ public class AnimatedValue : GLib.Object {
}
break;
}
+
} else if (this.val != this.end) {
this.val = this.end;
}