We are going to reuse this code for drag select. Might as well let
this work, although it is a bit exciting and I think right now you
can't be in wresting mode and also special select.
Signed-off-by: Ian Jackson <ijackson@chiark.greenend.org.uk>
): MouseFindClicked {
let clicked: PieceId[];
let held;
- let pinned;
+ let pinned = false;
clicked = [];
let uelem = defs_marker;
}
let piece = uelem.dataset.piece!;
let p = pieces[piece];
+ if (p.pinned && !wresting) continue;
if (!predicate(p)) {
continue;
}
+ if (p.pinned) pinned = true;
if (i > 0) {
- if (p.pinned != pinned ||
- p.held != held) {
- add_log_message(`Mixed pinned/held states! Stopped after ${i}`);
+ if (p.held != held) {
+ add_log_message(`Mixed held states! Stopped after ${i}`);
return null;
}
}
clicked.push(piece);
- pinned = p.pinned;
held = p.held;
}
if (clicked.length == 0) return null;