From a9e92e335c3f658ced46b6c6ca1362335b8b8b6f Mon Sep 17 00:00:00 2001 From: Michael Drake Date: Tue, 20 Aug 2013 15:02:09 +0100 Subject: Fix node insertion ancestor height updating having cumulative effect. --- desktop/treeview.c | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) (limited to 'desktop/treeview.c') diff --git a/desktop/treeview.c b/desktop/treeview.c index 6aa1a4eb7..9c21621e7 100644 --- a/desktop/treeview.c +++ b/desktop/treeview.c @@ -404,20 +404,20 @@ static inline void treeview_insert_node(treeview_node *a, } if (a->parent->flags & TREE_NODE_EXPANDED) { + int height = a->height; /* Parent is expanded, so inserted node will be visible and * affect layout */ - b = a; - do { - b->parent->height += b->height; - b = b->parent; - } while (b->parent != NULL); - if (a->text.width == 0) { nsfont.font_width(&plot_style_odd.text, a->text.data, a->text.len, &(a->text.width)); } + + do { + a->parent->height += height; + a = a->parent; + } while (a->parent != NULL); } } -- cgit v1.2.3