summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorPatrick McDermott <pj@pehjota.net>2017-09-25 00:02:34 (EDT)
committer Patrick McDermott <pj@pehjota.net>2017-09-25 00:02:34 (EDT)
commit9247ac5315621731adb2433d0ad002f426659e8b (patch)
tree260083d605bfbe049389cdcb37532a93f7cb51d0
parent89fd1a17e9d3ccc67ba1a395eb0882bdce242893 (diff)
downloadmarquee-9247ac5315621731adb2433d0ad002f426659e8b.zip
marquee-9247ac5315621731adb2433d0ad002f426659e8b.tar.gz
marquee-9247ac5315621731adb2433d0ad002f426659e8b.tar.bz2
MqTab: Fix positions of appended children
-rw-r--r--src/tab.c3
1 files changed, 2 insertions, 1 deletions
diff --git a/src/tab.c b/src/tab.c
index 8e6bf0d..22fdc3e 100644
--- a/src/tab.c
+++ b/src/tab.c
@@ -74,11 +74,12 @@ append_child(MqTab *new_node, MqTab *parent)
new_node->next = NULL;
new_node->prev = parent->last_child; /* May be NULL */
new_node->first_child = new_node->last_child = NULL;
- new_node->position = parent->position; /* Will be updated */
new_node->tree_size = 0; /* Will be updated */
if (parent->last_child) {
+ new_node->position = parent->last_child->position;
parent->last_child->next = new_node;
} else {
+ new_node->position = parent->position;
parent->first_child = new_node;
}
parent->last_child = new_node;