summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorBent Bisballe Nyeng <deva@aasimon.org>2011-11-30 09:43:09 +0100
committerBent Bisballe Nyeng <deva@aasimon.org>2011-11-30 09:43:09 +0100
commit4c2626ad56b871cf3b12cdfa786e632b3f29a71e (patch)
tree1161ba1188a761766a6b2b5382db671e2cb8097f
parentcc3e4ba1e4c93ab2198453e04039e57387a79e60 (diff)
Make sure we don't 'bounce' around when animating to the same height.
-rw-r--r--client/collapser.cc10
1 files changed, 8 insertions, 2 deletions
diff --git a/client/collapser.cc b/client/collapser.cc
index 599397f..a802396 100644
--- a/client/collapser.cc
+++ b/client/collapser.cc
@@ -110,8 +110,14 @@ void Collapser::anim()
placeholder.setWeight(x);
- int height = (int)((1 - y) * placeholder.fromHeight() +
- y * placeholder.toHeight());
+ // Make sure we don't 'bounce' around when animating to the same height.
+ int height;
+ if(placeholder.fromHeight() == placeholder.toHeight()) {
+ height = placeholder.fromHeight();
+ } else {
+ height = (int)((1 - y) * placeholder.fromHeight() +
+ y * placeholder.toHeight());
+ }
setFixedHeight(height);