Remove render-time viewport focus sampling

This commit is contained in:
Meta Vens 2026-05-23 19:48:49 +01:00
commit cf4d4a17e9

View file

@ -464,16 +464,7 @@ export function EpiphanyGraphViewer({
selection?.kind === "node" && selection.graphKey === activeGraphKey && activeLayout
? activeLayout.nodes.find((node) => node.id === selection.nodeId) ?? null
: null;
const viewportFocusedNode =
focusSelection && activeLayout && viewportSize.width > 0 && viewportSize.height > 0
? nodeNearestViewportCenter(
activeLayout.nodes,
activeTransform,
viewportSize.width,
viewportSize.height,
)
: null;
const selectedNode = focusSelection ? viewportFocusedNode ?? selectionNode : selectionNode;
const selectedNode = selectionNode;
const selectedEdge =
selection?.kind === "edge" && selection.graphKey === activeGraphKey && activeLayout
? activeLayout.edges.find((edge) => edge.resolvedId === selection.edgeId) ?? null