From 7a066cdd724e31b86398e37c3dcd2562c020e1d2 Mon Sep 17 00:00:00 2001 From: Joel Holdsworth Date: Sat, 24 Jan 2009 14:16:33 +0000 Subject: [PATCH] Fixed bug in measure branch height --- .../timeline/timeline-layout-helper.cpp | 25 +++++++++++-------- 1 file changed, 14 insertions(+), 11 deletions(-) diff --git a/src/gui/widgets/timeline/timeline-layout-helper.cpp b/src/gui/widgets/timeline/timeline-layout-helper.cpp index a67fd94bd..696824b42 100644 --- a/src/gui/widgets/timeline/timeline-layout-helper.cpp +++ b/src/gui/widgets/timeline/timeline-layout-helper.cpp @@ -274,18 +274,21 @@ TimelineLayoutHelper::measure_branch_height( int branch_height = parent_track->get_height() + TimelineWidget::TrackPadding; - TrackTree::sibling_iterator iterator; - for(iterator = layoutTree.begin(parent_iterator); - iterator != layoutTree.end(parent_iterator); - iterator++) - { - shared_ptr child_track = - lookup_timeline_track(*iterator); - - if(child_track->get_expanded()) - branch_height += measure_branch_height(iterator); + // Add the heights of child tracks if this parent is expanded + if(parent_track->get_expanded()) + { + TrackTree::sibling_iterator iterator; + for(iterator = layoutTree.begin(parent_iterator); + iterator != layoutTree.end(parent_iterator); + iterator++) + { + shared_ptr child_track = + lookup_timeline_track(*iterator); + + branch_height += measure_branch_height(iterator); + } } - + return branch_height; }