From: Ian Jackson Date: Thu, 25 Mar 2021 16:52:17 +0000 (+0000) Subject: selection display: Totally redo, solid is now normal self X-Git-Tag: otter-0.5.0~412 X-Git-Url: https://www.chiark.greenend.org.uk/ucgi/~ianmdlvl/git?a=commitdiff_plain;h=82bd5f6f985e2970a8f297d075922f426af23e51;p=otter.git selection display: Totally redo, solid is now normal self Signed-off-by: Ian Jackson --- diff --git a/templates/script.ts b/templates/script.ts index 0b8dc2ad..165e5e10 100644 --- a/templates/script.ts +++ b/templates/script.ts @@ -816,19 +816,21 @@ function redisplay_ancillaries(piece: PieceId, p: PieceInfo) { p.pelem.prepend(nelem); } if (p.held != null) { - let us_inoccult = false; - if (p.held == us) { + let da = null; + if (p.held != us) { + da = players[p.held!]!.dasharray; + } else { let [px, py] = piece_xy(p); - if (occregions.contains_pos(px, py)) { - us_inoccult = true; + let inoccult = occregions.contains_pos(px, py); + p.held_us_inoccult = inoccult; + if (inoccult) { + da = "0.9 0.6"; // dotted dasharray } } let nelem = ancillary_node(piece, held_surround_colour); - if (!us_inoccult) { - let da = players[p.held!]!.dasharray; + if (da !== null) { nelem.setAttributeNS(null,'stroke-dasharray',da); } - p.held_us_inoccult = us_inoccult; p.pelem.appendChild(nelem); } }