chiark / gitweb /
selection display: Totally redo, solid is now normal self
authorIan Jackson <ijackson@chiark.greenend.org.uk>
Thu, 25 Mar 2021 16:52:17 +0000 (16:52 +0000)
committerIan Jackson <ijackson@chiark.greenend.org.uk>
Thu, 25 Mar 2021 16:52:17 +0000 (16:52 +0000)
Signed-off-by: Ian Jackson <ijackson@chiark.greenend.org.uk>
templates/script.ts

index 0b8dc2ad8e2b1f8867bd998c50faec174ed88fe2..165e5e10ef9ab1e410e269c290cebe2f802c3759 100644 (file)
@@ -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);
   }
 }