fix: Minimap panning fix. issue #3625

This commit is contained in:
Miri Dagan
2023-11-15 14:26:58 +02:00
parent cc1d8ccadd
commit 62cea44ea7
+1 -2
View File
@@ -61,8 +61,7 @@ export function XYMinimap({ domNode, panZoom, getTransform, getViewScale }: XYMi
return;
}
// @TODO: how to calculate the correct next position? Math.max(1, transform[2]) is a workaround.
const moveScale = getViewScale() * Math.max(1, transform[2]) * (inversePan ? -1 : 1);
const moveScale = getViewScale() * Math.max(transform[2], Math.log(transform[2])) * (inversePan ? -1 : 1);
const position = {
x: transform[0] - event.sourceEvent.movementX * moveScale,
y: transform[1] - event.sourceEvent.movementY * moveScale,