resolved some requested changes
This commit is contained in:
@@ -97,8 +97,8 @@ function toHandleBounds(handles?: NodeHandle[]) {
|
||||
}
|
||||
|
||||
function getHandlePosition(position: Position, node: InternalNodeBase, handle: HandleElement | null = null): number[] {
|
||||
const x = (handle?.x ?? 0) + (node.internals.positionAbsolute?.x ?? 0);
|
||||
const y = (handle?.y ?? 0) + (node.internals.positionAbsolute?.y ?? 0);
|
||||
const x = (handle?.x ?? 0) + node.internals.positionAbsolute.x;
|
||||
const y = (handle?.y ?? 0) + node.internals.positionAbsolute.y;
|
||||
const { width, height } = handle ?? getNodeDimensions(node);
|
||||
|
||||
switch (position) {
|
||||
|
||||
@@ -107,7 +107,7 @@ export function adoptUserNodes<NodeType extends NodeBase>(
|
||||
},
|
||||
internals: {
|
||||
positionAbsolute: userNode.position,
|
||||
handleBounds: currentStoreNode?.internals?.handleBounds,
|
||||
handleBounds: currentStoreNode?.internals.handleBounds,
|
||||
z: (isNumeric(userNode.zIndex) ? userNode.zIndex : 0) + (userNode.selected ? selectedNodeZ : 0),
|
||||
userNode,
|
||||
isParent: false,
|
||||
|
||||
@@ -55,8 +55,8 @@ export function getDragItems<NodeType extends NodeBase>(
|
||||
id: internalNode.id,
|
||||
position: internalNode.position || { x: 0, y: 0 },
|
||||
distance: {
|
||||
x: mousePos.x - (internalNode.internals.positionAbsolute?.x ?? 0),
|
||||
y: mousePos.y - (internalNode.internals.positionAbsolute?.y ?? 0),
|
||||
x: mousePos.x - internalNode.internals.positionAbsolute.x,
|
||||
y: mousePos.y - internalNode.internals.positionAbsolute.y,
|
||||
},
|
||||
extent: internalNode.extent,
|
||||
parentId: internalNode.parentId,
|
||||
|
||||
@@ -22,8 +22,8 @@ export function getHandles(
|
||||
id: h.id || null,
|
||||
type,
|
||||
nodeId: node.id,
|
||||
x: (node.internals.positionAbsolute.x ?? 0) + h.x + h.width / 2,
|
||||
y: (node.internals.positionAbsolute.y ?? 0) + h.y + h.height / 2,
|
||||
x: node.internals.positionAbsolute.x + h.x + h.width / 2,
|
||||
y: node.internals.positionAbsolute.y + h.y + h.height / 2,
|
||||
});
|
||||
}
|
||||
return res;
|
||||
|
||||
Reference in New Issue
Block a user