docs: add comment about topSoFar

This commit is contained in:
vezwork 2022-05-20 07:27:25 -04:00 committed by Cole Lawrence
parent b84f2eb106
commit 0fa9608587

View file

@ -131,7 +131,9 @@ export const calculateSequenceEditorTree = (
} }
arrayOfChildren.push(row) arrayOfChildren.push(row)
nSoFar += 1 nSoFar += 1
topSoFar += HEIGHT_OF_ANY_TITLE // As we add rows to the tree, top to bottom, we accumulate the pixel
// distance to the top of the tree from the bottom of the current row:
topSoFar += row.nodeHeight
if (!isCollapsed) { if (!isCollapsed) {
addProps( addProps(
sheetObject, sheetObject,
@ -235,7 +237,7 @@ export const calculateSequenceEditorTree = (
n: nSoFar, n: nSoFar,
} }
arrayOfChildren.push(row) arrayOfChildren.push(row)
topSoFar += HEIGHT_OF_ANY_TITLE topSoFar += row.nodeHeight
if (!isCollapsed) { if (!isCollapsed) {
nSoFar += 1 nSoFar += 1
@ -275,7 +277,7 @@ export const calculateSequenceEditorTree = (
} }
arrayOfChildren.push(row) arrayOfChildren.push(row)
nSoFar += 1 nSoFar += 1
topSoFar += HEIGHT_OF_ANY_TITLE topSoFar += row.nodeHeight
} }
return tree return tree