@@ -118,7 +118,6 @@ const _inPlaceEvenSpacingUpdate = (
118
118
numChildren : number ,
119
119
// eslint-disable-next-line @typescript-eslint/prefer-readonly-parameter-types
120
120
tree : DeepWriteable < TreeWithLayout > ,
121
- shift : number ,
122
121
// eslint-disable-next-line @typescript-eslint/prefer-readonly-parameter-types
123
122
offsets : number [ ] ,
124
123
depth : number ,
@@ -128,20 +127,20 @@ const _inPlaceEvenSpacingUpdate = (
128
127
const tm = tree . meta
129
128
const tmp = tm . pos
130
129
if ( numChildren === 0 ) {
131
- tmp . x = M ( offsets [ depth ] ?? 0 , tmp . x + shift )
130
+ tmp . x = M ( offsets [ depth ] ?? 0 , tmp . x )
132
131
delete tm . m
133
132
} else if ( numChildren === 1 ) {
134
133
// eslint-disable-next-line @typescript-eslint/no-non-null-assertion
135
134
const c = _getPosX ( tree [ C ] ! [ 0 ] ! )
136
- tmp . x = M ( offsets [ depth ] ?? 0 , c + shift )
135
+ tmp . x = M ( offsets [ depth ] ?? 0 , c )
137
136
tm . m = tmp . x - c
138
137
} else {
139
138
const c = // eslint-disable-next-line @typescript-eslint/no-non-null-assertion
140
139
( _getPosX ( tree [ C ] ! [ 0 ] ! ) +
141
140
// eslint-disable-next-line @typescript-eslint/no-non-null-assertion
142
141
_getPosX ( tree [ C ] ! [ numChildren - 1 ] ! ) ) *
143
142
0.5
144
- tmp . x = M ( offsets [ depth ] ?? 0 , c + shift )
143
+ tmp . x = M ( offsets [ depth ] ?? 0 , c )
145
144
tm . m = tmp . x - c
146
145
}
147
146
tracer . mX = M ( tracer . mX , tmp . x )
@@ -208,45 +207,7 @@ const _siblingsEvenSpacing = (
208
207
)
209
208
}
210
209
211
- _inPlaceEvenSpacingUpdate ( numChildren , tree , 0 , offsets , depth , tracer )
212
- }
213
-
214
- const _cousinsEvenSpacing = (
215
- // eslint-disable-next-line @typescript-eslint/prefer-readonly-parameter-types
216
- tree : DeepWriteable < TreeWithLayout > ,
217
- // eslint-disable-next-line @typescript-eslint/prefer-readonly-parameter-types
218
- offsets : number [ ] ,
219
- // eslint-disable-next-line @typescript-eslint/prefer-readonly-parameter-types
220
- tracer : { mX : number } ,
221
- depth = 0 ,
222
- shift = 0 ,
223
- ) : void => {
224
- const tc = tree [ C ]
225
- const numChildren = tc ?. length ?? 0
226
-
227
- const nextOffset = offsets [ depth + 1 ]
228
- let accShift = shift
229
- if (
230
- numChildren >= 2 &&
231
- nextOffset !== undefined &&
232
- // eslint-disable-next-line @typescript-eslint/no-non-null-assertion
233
- ( tc ! [ 0 ] ! . node [ C ] ?. length ?? 0 ) === 0
234
- ) {
235
- // eslint-disable-next-line @typescript-eslint/no-non-null-assertion
236
- const mid = _getPosX ( tc ! [ 1 ] ! ) - 1
237
- // eslint-disable-next-line @typescript-eslint/no-non-null-assertion
238
- accShift = shift + M ( 0 , mid - _getPosX ( tc ! [ 0 ] ! ) )
239
- }
240
-
241
- for ( const [ idx , { node } ] of ( tc ?? [ ] ) . entries ( ) ) {
242
- if ( idx === 0 ) {
243
- _cousinsEvenSpacing ( node , offsets , tracer , depth + 1 , accShift )
244
- } else {
245
- _cousinsEvenSpacing ( node , offsets , tracer , depth + 1 , shift )
246
- }
247
- }
248
-
249
- _inPlaceEvenSpacingUpdate ( numChildren , tree , shift , offsets , depth , tracer )
210
+ _inPlaceEvenSpacingUpdate ( numChildren , tree , offsets , depth , tracer )
250
211
}
251
212
252
213
export const computeSmartLayout = (
@@ -258,9 +219,6 @@ export const computeSmartLayout = (
258
219
const t = _computeSmartLayout ( tree , 0 , offsets , tracer )
259
220
_addMods ( t , 0 , tracer )
260
221
261
- _cousinsEvenSpacing ( t , [ ] , tracer )
262
- _addMods ( t , 0 , tracer )
263
-
264
222
_siblingsEvenSpacing ( t , [ ] , tracer )
265
223
_addMods ( t , 0 , tracer )
266
224
0 commit comments