Skip to content

Commit 4a6aaba

Browse files
committed
refactor: minor code move
Signed-off-by: Andres Correa Casablanca <castarco@coderspirit.xyz>
1 parent 4187b25 commit 4a6aaba

File tree

1 file changed

+8
-7
lines changed

1 file changed

+8
-7
lines changed

src/layouts.ts

Lines changed: 8 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -145,6 +145,14 @@ const _inPlaceEvenSpacingUpdate = (
145145
}
146146
tracer.mX = M(tracer.mX, tmp.x)
147147
offsets[depth] = 1 + tmp.x
148+
149+
if (numChildren > 0) {
150+
offsets[depth + 1] = M(
151+
offsets[depth + 1] ?? 0,
152+
// eslint-disable-next-line @typescript-eslint/no-non-null-assertion
153+
tree[C]![numChildren - 1]!.node.meta.pos.x + 1 + (tm.m ?? 0),
154+
)
155+
}
148156
}
149157

150158
const _siblingsEvenSpacing = (
@@ -199,13 +207,6 @@ const _siblingsEvenSpacing = (
199207
node.meta.pos.x += accShift
200208
node.meta.m = (node.meta.m ?? 0) + accShift
201209
}
202-
if (numChildren > 0) {
203-
offsets[depth + 1] = M(
204-
offsets[depth + 1] ?? 0,
205-
// eslint-disable-next-line @typescript-eslint/no-non-null-assertion
206-
tc![numChildren - 1]!.node.meta.pos.x + 1,
207-
)
208-
}
209210

210211
_inPlaceEvenSpacingUpdate(numChildren, tree, offsets, depth, tracer)
211212
}

0 commit comments

Comments
 (0)