revert(types): use state viewport zoom to calculate handlebounds
This commit is contained in:
@@ -70,11 +70,6 @@ export default (state: State, getters: ComputedGetters): Actions => {
|
|||||||
}
|
}
|
||||||
|
|
||||||
const updateNodeDimensions: Actions['updateNodeDimensions'] = (updates) => {
|
const updateNodeDimensions: Actions['updateNodeDimensions'] = (updates) => {
|
||||||
if (!state.viewportRef) return
|
|
||||||
|
|
||||||
const style = window.getComputedStyle(state.viewportRef)
|
|
||||||
const { m22: zoom } = new window.DOMMatrixReadOnly(style.transform)
|
|
||||||
|
|
||||||
const changes: NodeDimensionChange[] = updates.reduce<NodeDimensionChange[]>((res, update) => {
|
const changes: NodeDimensionChange[] = updates.reduce<NodeDimensionChange[]>((res, update) => {
|
||||||
const node = getters.getNode.value(update.id)
|
const node = getters.getNode.value(update.id)
|
||||||
|
|
||||||
@@ -87,8 +82,8 @@ export default (state: State, getters: ComputedGetters): Actions => {
|
|||||||
)
|
)
|
||||||
|
|
||||||
node.handleBounds = {
|
node.handleBounds = {
|
||||||
source: getHandleBounds('.source', update.nodeElement, zoom),
|
source: getHandleBounds('.source', update.nodeElement, state.viewport.zoom),
|
||||||
target: getHandleBounds('.target', update.nodeElement, zoom),
|
target: getHandleBounds('.target', update.nodeElement, state.viewport.zoom),
|
||||||
}
|
}
|
||||||
|
|
||||||
if (doUpdate) {
|
if (doUpdate) {
|
||||||
|
|||||||
Reference in New Issue
Block a user