summaryrefslogtreecommitdiff
path: root/desktop/treeview.c
diff options
context:
space:
mode:
authorMichael Drake <tlsa@netsurf-browser.org>2013-08-20 15:02:09 +0100
committerMichael Drake <tlsa@netsurf-browser.org>2013-08-20 15:02:09 +0100
commita9e92e335c3f658ced46b6c6ca1362335b8b8b6f (patch)
tree2da2eae0f0fbe5887f75eae7928e3ffb12c15f59 /desktop/treeview.c
parent9f3a83da66b4a8d84ba9cc3f00dcedb6d6b9620f (diff)
downloadnetsurf-a9e92e335c3f658ced46b6c6ca1362335b8b8b6f.tar.gz
netsurf-a9e92e335c3f658ced46b6c6ca1362335b8b8b6f.tar.bz2
Fix node insertion ancestor height updating having cumulative effect.
Diffstat (limited to 'desktop/treeview.c')
-rw-r--r--desktop/treeview.c12
1 files changed, 6 insertions, 6 deletions
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);
}
}