From e79344580ea76df4f60be0caf2d49b8c598f4100 Mon Sep 17 00:00:00 2001 From: Ian Jackson Date: Wed, 13 Jan 2021 22:19:38 +0000 Subject: [PATCH] click elsewhere, or on pinned piece, deselects all, only unshifted Signed-off-by: Ian Jackson --- templates/script.ts | 11 ++++++----- 1 file changed, 6 insertions(+), 5 deletions(-) diff --git a/templates/script.ts b/templates/script.ts index a9320c1e..e5497ae7 100644 --- a/templates/script.ts +++ b/templates/script.ts @@ -672,7 +672,9 @@ function drag_mousedown(e : MouseEvent, shifted: boolean) { var target = e.target as SVGGraphicsElement; // we check this just now! var piece = target.dataset.piece!; if (!piece) { - ungrab_all(); + if (!shifted) { + ungrab_all(); + } return; } let p = pieces[piece]!; @@ -691,14 +693,13 @@ function drag_mousedown(e : MouseEvent, shifted: boolean) { drag_add_piece(tpiece,tp); } } else if (held == null || wresting) { + if (!shifted) { + ungrab_all(); + } if (p.pinned && !wresting) { add_log_message('That piece is pinned to the table.'); - ungrab_all(); return; } - if (!shifted) { - ungrab_all(); - } dragging = DRAGGING.MAYBE_GRAB; drag_add_piece(piece,p); set_grab(piece,p, us); -- 2.30.2