From 7a8e7c9a181fc6d85567a1076f02de4f187d1a41 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Mitja=20Bezen=C5=A1ek?= Date: Fri, 26 Apr 2024 13:31:18 +0200 Subject: [PATCH] Add back the old check. --- .../tldraw/src/lib/ui/components/Minimap/DefaultMinimap.tsx | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/packages/tldraw/src/lib/ui/components/Minimap/DefaultMinimap.tsx b/packages/tldraw/src/lib/ui/components/Minimap/DefaultMinimap.tsx index 78117534e..5ef1976e0 100644 --- a/packages/tldraw/src/lib/ui/components/Minimap/DefaultMinimap.tsx +++ b/packages/tldraw/src/lib/ui/components/Minimap/DefaultMinimap.tsx @@ -85,7 +85,10 @@ export function DefaultMinimap() { const commonBounds = Box.Common([editor.getCurrentPageBounds() ?? new Box(), _vpPageBounds]) // If we clicked inside of the allowed area, but outside of the viewport, we wish to move the camera - if (commonBounds.containsPoint(point) && !_vpPageBounds.containsPoint(point)) { + if ( + (commonBounds.containsPoint(point) && !_vpPageBounds.containsPoint(point)) || + !minimapRef.current.isInViewport + ) { const delta = Vec.Sub(_vpPageBounds.center, _vpPageBounds.point) const pagePoint = Vec.Add(point, delta) minimapRef.current.originPagePoint.setTo(pagePoint)