From: Ian Jackson Date: Sat, 3 Apr 2021 23:31:19 +0000 (+0100) Subject: js: Handle special_count of >1 X-Git-Tag: otter-0.5.0~211 X-Git-Url: https://www.chiark.greenend.org.uk/ucgi/~ianmdlvl/git?a=commitdiff_plain;h=8fbab1e7e2f3b6d1887f23ff3509a8dc28d7a93d;p=otter.git js: Handle special_count of >1 Signed-off-by: Ian Jackson --- diff --git a/templates/script.ts b/templates/script.ts index d595506c..ab73bb94 100644 --- a/templates/script.ts +++ b/templates/script.ts @@ -845,8 +845,28 @@ function drag_mousedown(e : MouseEvent, shifted: boolean) { } } } else { - mouseevent_pos(e); - return; + // special_count > 0 + clicked = []; + let uelem = defs_marker; + for (let i=0; i 0) { + if (p.pinned != pinned || + p.held != held) { + add_log_message(`Mixed pinned/held states! Stopped after ${i}`); + return; + } + } + clicked.push(piece); + pinned = p.pinned; + held = p.held; + } } if (!clicked.length) {