chiark / gitweb /
clear halo when we touch a thing
authorIan Jackson <ijackson@chiark.greenend.org.uk>
Sun, 12 Jul 2020 21:14:09 +0000 (22:14 +0100)
committerIan Jackson <ijackson@chiark.greenend.org.uk>
Sun, 12 Jul 2020 21:14:09 +0000 (22:14 +0100)
templates/script.ts

index 94e2d06ba45d2f0a92af736ae4e30099246497d6..4f6eb7579489cd440f35095612cd820c51b8c782 100644 (file)
@@ -149,6 +149,7 @@ function api_piece(f: (meth: string, payload: Object) => void,
                   meth: string,
                   piece: PieceId, p: PieceInfo,
                   op: Object) {
+  clear_halo(piece,p);
   cseq += 1;
   p.cseq = cseq;
   f(meth, {
@@ -247,6 +248,11 @@ function set_ungrab(piece: PieceId, p: PieceInfo) {
   redisplay_ancillaries(piece,p);
 }
 
+function clear_halo(piece: PieceId, p: PieceInfo) {
+  p.last_seen_moved = null;
+  redisplay_ancillaries(piece,p);
+}
+
 function ancillary_node(piece: PieceId, stroke: string): SVGGraphicsElement {
   var nelem = document.createElementNS(svg_ns,'use');
   nelem.setAttributeNS(null,'href','#surround'+piece);