From d02ce9b28343c5df901f2d7bf48834cdbbda05db Mon Sep 17 00:00:00 2001 From: Joel Holdsworth Date: Fri, 9 Jan 2009 23:28:51 +0000 Subject: [PATCH] Fixed minor bug in expander animation --- src/gui/widgets/timeline/timeline-track.cpp | 13 ++++++------- 1 file changed, 6 insertions(+), 7 deletions(-) diff --git a/src/gui/widgets/timeline/timeline-track.cpp b/src/gui/widgets/timeline/timeline-track.cpp index 7b1f526d5..ef90d76d9 100644 --- a/src/gui/widgets/timeline/timeline-track.cpp +++ b/src/gui/widgets/timeline/timeline-track.cpp @@ -183,14 +183,13 @@ Track::tick_expand_animation() Gtk::ExpanderStyle Track::get_expander_style() const { - const int notch = 1.0 / 3.0; if(expanded) { if(expandDirection == None) return EXPANDER_EXPANDED; - else if(expandAnimationState >= notch * 2.0) + else if(expandAnimationState >= 2.0 / 3.0) return EXPANDER_SEMI_EXPANDED; - else if(expandAnimationState >= notch) + else if(expandAnimationState >= 1.0 / 3.0) return EXPANDER_SEMI_COLLAPSED; else return EXPANDER_COLLAPSED; @@ -199,12 +198,12 @@ Track::get_expander_style() const { if(expandDirection == None) return EXPANDER_COLLAPSED; - else if(expandAnimationState <= notch) - return EXPANDER_SEMI_COLLAPSED; - else if(expandAnimationState <= notch * 2.0) + else if(expandAnimationState >= 2.0 / 3.0) + return EXPANDER_EXPANDED; + else if(expandAnimationState >= 1.0 / 3.0) return EXPANDER_SEMI_EXPANDED; else - return EXPANDER_EXPANDED; + return EXPANDER_SEMI_COLLAPSED; } ERROR(gui, "Track::get_expander_style() final return reached");