Skip to content
Snippets Groups Projects
Commit 3041e158 authored by Dennis Collaris's avatar Dennis Collaris
Browse files

fix: adopt changes in !159

parent 02de1387
No related branches found
No related tags found
No related merge requests found
......@@ -46,7 +46,7 @@ type LayoutState = 'reset' | 'running' | 'paused';
export const NLPixi = (props: Props) => {
const [quickPopup, setQuickPopup] = useState<{ node: NodeType; pos: IPointData } | undefined>();
const [popups, setPopups] = useState<{ node: NodeType; pos: IPointData }[]>([]);
const [popups, setPopups] = useState<{ node: NodeTypeD3; pos: IPointData }[]>([]);
const [assetsLoaded, setAssetsLoaded] = useState(false);
const app = useMemo(
......@@ -138,7 +138,7 @@ export const NLPixi = (props: Props) => {
}
const sprite = event.target as Sprite;
const node = (sprite as any).node as NodeType;
const node = (sprite as any).node as NodeTypeD3;
if (event.shiftKey) {
setPopups([...popups, { node: node, pos: toGlobal(node) }]);
......@@ -172,7 +172,7 @@ export const NLPixi = (props: Props) => {
onHover(event: FederatedPointerEvent) {
const sprite = event.target as Sprite;
const node = (sprite as any).node as NodeType;
const node = (sprite as any).node as NodeTypeD3;
if (
mouseInCanvas.current &&
viewport?.current &&
......@@ -234,7 +234,7 @@ export const NLPixi = (props: Props) => {
} else return { x: 0, y: 0 };
}
const updateNode = (node: NodeType) => {
const updateNode = (node: NodeTypeD3) => {
const gfx = nodeMap.current.get(node._id);
if (!gfx) return;
......@@ -620,7 +620,7 @@ export const NLPixi = (props: Props) => {
<Tooltip key={popup.node._id} open={true} boundaryElement={ref} showArrow={true}>
<TooltipTrigger x={popup.pos.x} y={popup.pos.y} />
<TooltipContent>
<NLPopup onClose={() => {}} data={popup} key={popup.node._id} />
<NLPopup onClose={() => {}} data={{node: props.graph.nodes[popup.node._id], pos: popup.pos}} key={popup.node._id} />
</TooltipContent>
</Tooltip>
))}
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment