refactor(core): use for loop

This commit is contained in:
braks
2024-06-07 10:44:59 +02:00
committed by Braks
parent cd5103e525
commit 9a7e4ac952

View File

@@ -142,9 +142,11 @@ export function useActions(
const style = window.getComputedStyle(viewportNode)
const { m22: zoom } = new window.DOMMatrixReadOnly(style.transform)
const changes: NodeDimensionChange[] = []
const changes: NodeDimensionChange[] = Array.from({ length: updates.length })
for (let i = 0; i < updates.length; ++i) {
const update = updates[i]
for (const update of updates) {
const node = findNode(update.id)
if (node) {
@@ -163,11 +165,11 @@ export function useActions(
node.handleBounds.target = getHandleBounds('.target', update.nodeElement, nodeBounds, zoom)
node.initialized = true
changes.push({
changes[i] = {
id: node.id,
type: 'dimensions',
dimensions,
})
}
}
}
}