From f0a16ec8ab72329537f929040c9653ef3bbea718 Mon Sep 17 00:00:00 2001 From: KartikWatts Date: Tue, 23 Jul 2024 16:05:33 +0530 Subject: [PATCH] fix `snapToValidMove` update issue --- src/draw.ts | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/src/draw.ts b/src/draw.ts index 01bec4c0..97fd8214 100644 --- a/src/draw.ts +++ b/src/draw.ts @@ -87,9 +87,7 @@ export function processDraw(state: State): void { const cur = state.drawable.current; if (cur) { const keyAtDomPos = getKeyAtDomPos(cur.pos, whitePov(state), state.dom.bounds()); - if (!keyAtDomPos) { - cur.snapToValidMove = false; - } + cur.snapToValidMove = !!keyAtDomPos; const mouseSq = cur.snapToValidMove ? getSnappedKeyAtDomPos(cur.orig, cur.pos, whitePov(state), state.dom.bounds()) : keyAtDomPos;