fixed connectionLine not updating correctly on auto pan

This commit is contained in:
peterkogo
2024-06-27 13:44:30 +02:00
parent 6cc6960895
commit 941898b97d
5 changed files with 35 additions and 19 deletions
+6 -5
View File
@@ -2,12 +2,13 @@ import { shallow } from 'zustand/shallow';
import { useStore } from './useStore';
import type { ReactFlowStore } from '../types/store';
import { ConnectionState } from '@xyflow/system';
const selector = (s: ReactFlowStore) => ({
...s.connection,
});
import { ConnectionState, pointToRendererPoint } from '@xyflow/system';
const selector = (s: ReactFlowStore): ConnectionState => {
return s.connection.inProgress
? { ...s.connection, to: pointToRendererPoint(s.connection.to, s.transform) }
: { ...s.connection };
};
/**
* Hook for accessing the connection state.
*