diff options
-rw-r--r-- | client/collapser.cc | 10 |
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); |