chore(minimap): cleanup

This commit is contained in:
moklick
2026-01-27 11:23:28 +01:00
parent 2db23d9eab
commit b4e69a1fa3

View File

@@ -84,16 +84,18 @@ function NodeComponentWrapperInner<NodeType extends Node>({
shapeRendering: string; shapeRendering: string;
}) { }) {
const { node, x, y, width, height } = useStore((s) => { const { node, x, y, width, height } = useStore((s) => {
const internals = s.nodeLookup.get(id)?.internals; const node = s.nodeLookup.get(id);
if (!internals) {
if (!node) {
return { node: undefined, x: 0, y: 0, width: 0, height: 0 }; return { node: undefined, x: 0, y: 0, width: 0, height: 0 };
} }
const node = internals.userNode as NodeType;
const { x, y } = internals.positionAbsolute; const userNode = node.internals.userNode as NodeType;
const { width, height } = getNodeDimensions(node); const { x, y } = node.internals.positionAbsolute;
const { width, height } = getNodeDimensions(userNode);
return { return {
node, node: userNode,
x, x,
y, y,
width, width,