fixed node extent calculation and simplified calculateNodePosition
This commit is contained in:
@@ -90,7 +90,7 @@ export function NodeWrapper<NodeType extends Node>({
|
||||
const inlineDimensions = getNodeInlineStyleDimensions(node);
|
||||
// TODO: clamping should happen earlier
|
||||
const clampedPosition = nodeExtent
|
||||
? clampPosition(internals.positionAbsolute, nodeExtent, node.measured, origin)
|
||||
? clampPosition(internals.positionAbsolute, nodeExtent, node.measured)
|
||||
: internals.positionAbsolute;
|
||||
|
||||
const hasPointerEvents = isSelectable || isDraggable || onClick || onMouseEnter || onMouseMove || onMouseLeave;
|
||||
|
||||
@@ -278,15 +278,10 @@ const createStore = ({
|
||||
triggerEdgeChanges(edgeChanges);
|
||||
},
|
||||
setNodeExtent: (nodeExtent) => {
|
||||
const { nodeLookup, nodeOrigin } = get();
|
||||
const { nodeLookup } = get();
|
||||
|
||||
for (const [, node] of nodeLookup) {
|
||||
const positionAbsolute = clampPosition(
|
||||
node.internals.positionAbsolute,
|
||||
nodeExtent,
|
||||
node.measured,
|
||||
node.origin ?? nodeOrigin
|
||||
);
|
||||
const positionAbsolute = clampPosition(node.internals.positionAbsolute, nodeExtent, node.measured);
|
||||
|
||||
nodeLookup.set(node.id, {
|
||||
...node,
|
||||
|
||||
Reference in New Issue
Block a user