From e674094f643a4333eb664f7936e22b8ae89f82ca Mon Sep 17 00:00:00 2001 From: joshvera Date: Wed, 2 Dec 2015 16:41:40 -0500 Subject: [PATCH] Sum the offset_point like offset in ts_tree_assign_parents --- src/runtime/tree.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/src/runtime/tree.c b/src/runtime/tree.c index 1b69692e..faa85820 100644 --- a/src/runtime/tree.c +++ b/src/runtime/tree.c @@ -46,16 +46,18 @@ TSTree *ts_tree_make_error(TSLength size, TSLength padding, void ts_tree_assign_parents(TSTree *self) { TSLength offset = ts_length_zero(); + TSPoint offset_point = ts_point_zero(); for (size_t i = 0; i < self->child_count; i++) { TSTree *child = self->children[i]; if (child->context.parent != self) { child->context.parent = self; child->context.index = i; child->context.offset = offset; - child->context.offset_point = ts_tree_offset_point(self); + child->context.offset_point = offset_point; ts_tree_assign_parents(child); } offset = ts_length_add(offset, ts_tree_total_size(child)); + offset_point = ts_point_add(offset_point, ts_tree_total_size_point(child)); } }