chore(core): cleanup
Signed-off-by: braks <78412429+bcakmakoglu@users.noreply.github.com>
This commit is contained in:
@@ -244,13 +244,14 @@ export default {
|
|||||||
:data="node.data"
|
:data="node.data"
|
||||||
:events="{ ...node.events, ...on }"
|
:events="{ ...node.events, ...on }"
|
||||||
:selected="!!node.selected"
|
:selected="!!node.selected"
|
||||||
|
:resizing="!!node.resizing"
|
||||||
|
:dragging="dragging"
|
||||||
:connectable="connectable"
|
:connectable="connectable"
|
||||||
:position="node.position"
|
:position="node.position"
|
||||||
:dimensions="node.dimensions"
|
:dimensions="node.dimensions"
|
||||||
:is-valid-target-pos="node.isValidTargetPos"
|
:is-valid-target-pos="node.isValidTargetPos"
|
||||||
:is-valid-source-pos="node.isValidSourcePos"
|
:is-valid-source-pos="node.isValidSourcePos"
|
||||||
:parent-node="node.parentNode"
|
:parent-node="node.parentNode"
|
||||||
:dragging="dragging"
|
|
||||||
:z-index="node.computedPosition.z"
|
:z-index="node.computedPosition.z"
|
||||||
:target-position="node.targetPosition"
|
:target-position="node.targetPosition"
|
||||||
:source-position="node.sourcePosition"
|
:source-position="node.sourcePosition"
|
||||||
|
|||||||
@@ -4,11 +4,13 @@ import type { SnapGrid } from '~/types'
|
|||||||
export function useGetPointerPosition() {
|
export function useGetPointerPosition() {
|
||||||
const { viewport, snapGrid: globalSnapGrid, snapToGrid } = useVueFlow()
|
const { viewport, snapGrid: globalSnapGrid, snapToGrid } = useVueFlow()
|
||||||
|
|
||||||
const hasSnapGrid = (sg?: SnapGrid) => (sg ?? snapToGrid ? globalSnapGrid : undefined)
|
const hasSnapGrid = (sg?: SnapGrid) => (sg ?? snapToGrid.value ? globalSnapGrid.value : undefined)
|
||||||
|
|
||||||
// returns the pointer position projected to the RF coordinate system
|
// returns the pointer position projected to the RF coordinate system
|
||||||
return ({ sourceEvent }: UseDragEvent, snapGrid?: SnapGrid) => {
|
return ({ sourceEvent }: UseDragEvent, snapGrid?: SnapGrid) => {
|
||||||
const currentSnapGrid = unref(hasSnapGrid(snapGrid || globalSnapGrid.value))
|
const currentSnapGrid = unref(hasSnapGrid(snapGrid))
|
||||||
|
|
||||||
|
console.log(currentSnapGrid)
|
||||||
|
|
||||||
const x = sourceEvent.touches ? sourceEvent.touches[0].clientX : sourceEvent.clientX
|
const x = sourceEvent.touches ? sourceEvent.touches[0].clientX : sourceEvent.clientX
|
||||||
const y = sourceEvent.touches ? sourceEvent.touches[0].clientY : sourceEvent.clientY
|
const y = sourceEvent.touches ? sourceEvent.touches[0].clientY : sourceEvent.clientY
|
||||||
|
|||||||
@@ -113,7 +113,11 @@ export const applyChanges = <
|
|||||||
if (typeof currentChange.dimensions !== 'undefined') element.dimensions = currentChange.dimensions
|
if (typeof currentChange.dimensions !== 'undefined') element.dimensions = currentChange.dimensions
|
||||||
|
|
||||||
if (typeof currentChange.updateStyle !== 'undefined') {
|
if (typeof currentChange.updateStyle !== 'undefined') {
|
||||||
element.style = { ...(element.style || {}), ...currentChange.dimensions }
|
element.style = {
|
||||||
|
...(element.style || {}),
|
||||||
|
width: `${currentChange.dimensions?.width}px`,
|
||||||
|
height: `${currentChange.dimensions?.height}px`,
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
if (typeof currentChange.resizing === 'boolean') element.resizing = currentChange.resizing
|
if (typeof currentChange.resizing === 'boolean') element.resizing = currentChange.resizing
|
||||||
|
|||||||
Reference in New Issue
Block a user