fix node extent
This commit is contained in:
@@ -42,7 +42,7 @@ export function NodeWrapper<NodeType extends Node>({
|
||||
nodeClickDistance,
|
||||
onError,
|
||||
}: NodeWrapperProps<NodeType>) {
|
||||
const { node, internals, isParent } = useStore((s) => {
|
||||
const { node, internals, isParent, origin } = useStore((s) => {
|
||||
const node = s.nodeLookup.get(id)! as InternalNode<NodeType>;
|
||||
const isParent = s.parentLookup.has(id);
|
||||
|
||||
@@ -50,6 +50,7 @@ export function NodeWrapper<NodeType extends Node>({
|
||||
node,
|
||||
internals: node.internals,
|
||||
isParent,
|
||||
origin: node.origin ?? s.nodeOrigin,
|
||||
};
|
||||
}, shallow);
|
||||
|
||||
@@ -89,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)
|
||||
? clampPosition(internals.positionAbsolute, nodeExtent, node.measured, origin)
|
||||
: internals.positionAbsolute;
|
||||
|
||||
const hasPointerEvents = isSelectable || isDraggable || onClick || onMouseEnter || onMouseMove || onMouseLeave;
|
||||
|
||||
Reference in New Issue
Block a user