variable autoPanSpeed
This commit is contained in:
@@ -44,6 +44,7 @@ function onPointerDown(
|
||||
updateConnection,
|
||||
getTransform,
|
||||
getFromHandle,
|
||||
autoPanSpeed,
|
||||
}: OnPointerDownParams
|
||||
) {
|
||||
// when xyflow is used inside a shadow root we can't use document
|
||||
@@ -78,7 +79,8 @@ function onPointerDown(
|
||||
if (!autoPanOnConnect || !containerBounds) {
|
||||
return;
|
||||
}
|
||||
const [x, y] = calcAutoPan(position, containerBounds);
|
||||
const transform = getTransform();
|
||||
const [x, y] = calcAutoPan(position, containerBounds, transform, autoPanSpeed);
|
||||
|
||||
panBy({ x, y });
|
||||
autoPanId = requestAnimationFrame(autoPan);
|
||||
|
||||
Reference in New Issue
Block a user