refactor(core): use for loop
This commit is contained in:
@@ -142,9 +142,11 @@ export function useActions(
|
|||||||
const style = window.getComputedStyle(viewportNode)
|
const style = window.getComputedStyle(viewportNode)
|
||||||
const { m22: zoom } = new window.DOMMatrixReadOnly(style.transform)
|
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)
|
const node = findNode(update.id)
|
||||||
|
|
||||||
if (node) {
|
if (node) {
|
||||||
@@ -163,11 +165,11 @@ export function useActions(
|
|||||||
node.handleBounds.target = getHandleBounds('.target', update.nodeElement, nodeBounds, zoom)
|
node.handleBounds.target = getHandleBounds('.target', update.nodeElement, nodeBounds, zoom)
|
||||||
node.initialized = true
|
node.initialized = true
|
||||||
|
|
||||||
changes.push({
|
changes[i] = {
|
||||||
id: node.id,
|
id: node.id,
|
||||||
type: 'dimensions',
|
type: 'dimensions',
|
||||||
dimensions,
|
dimensions,
|
||||||
})
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user