refactor(core): add connection start and end handles to store state
Signed-off-by: braks <78412429+bcakmakoglu@users.noreply.github.com>
This commit is contained in:
@@ -483,15 +483,16 @@ export function useActions(state: State, getters: ComputedGetters): Actions {
|
||||
state.connectionStartHandle = startHandle
|
||||
}
|
||||
|
||||
state.connectionEndHandle = null
|
||||
state.connectionStatus = null
|
||||
|
||||
if (position) state.connectionPosition = position
|
||||
}
|
||||
|
||||
const updateConnection: Actions['updateConnection'] = (position, result, status = null) => {
|
||||
const updateConnection: Actions['updateConnection'] = (position, result = null, status = null) => {
|
||||
if (state.connectionStartHandle) {
|
||||
state.connectionPosition = position
|
||||
state.connectionStartHandle.result = result
|
||||
state.connectionEndHandle = result
|
||||
state.connectionStatus = status
|
||||
}
|
||||
}
|
||||
|
||||
@@ -85,6 +85,7 @@ function defaultState(): State {
|
||||
},
|
||||
connectionMode: ConnectionMode.Loose,
|
||||
connectionStartHandle: null,
|
||||
connectionEndHandle: null,
|
||||
connectionClickStartHandle: null,
|
||||
connectionPosition: { x: NaN, y: NaN },
|
||||
connectionRadius: 20,
|
||||
|
||||
Reference in New Issue
Block a user