chiark / gitweb /
script: Make mouse cursor different in wresting mode
authorIan Jackson <ijackson@chiark.greenend.org.uk>
Sun, 12 Jun 2022 23:57:43 +0000 (00:57 +0100)
committerIan Jackson <ijackson@chiark.greenend.org.uk>
Mon, 13 Jun 2022 00:31:33 +0000 (01:31 +0100)
Signed-off-by: Ian Jackson <ijackson@chiark.greenend.org.uk>
templates/script.ts

index b6a774144beae4cd58c1d30551e642803e68dfb8..e28b4dd5413f3f8fcac8a3003d903f0329ef4de6 100644 (file)
@@ -548,7 +548,26 @@ function mousecursor_etc_reupdate() {
   let xy;
   let path = 'stroke-linecap="square" d="M -10 -10 10 10 M 10 -10 -10 10"';
   
-  if (special_count == null) {
+  if (wresting) {
+    let text;
+    if (special_count == null) {
+      text = "WREST";
+    } else if (special_count == 0) {
+      text = "W v";
+    } else {
+      text = "W " + special_count;
+    }
+    xy = '60 15';
+    svg =
+`<svg xmlns="http://www.w3.org/2000/svg"
+     viewBox="-60 -15 120 60" width="120" height="60">
+  <g transform="translate(0 0)">
+    <path stroke-width="8" stroke="black" ${path}/>
+    <path stroke-width="4" stroke="#cc0" ${path}/>
+ <text x="0" y="40" fill="black" stroke="#cc0" stroke-width="1.7" text-align="center" text-anchor="middle"
+ font-family="sans-serif" font-size="30">${text}</text>
+  </g></svg>`;
+  } else if (special_count == null) {
   } else {
     if (special_count != 0) {
       let text_len = special_count.toString().length;