From: Ian Jackson Date: Sat, 3 Apr 2021 21:06:21 +0000 (+0100) Subject: special selection: special case for zero X-Git-Tag: otter-0.5.0~221 X-Git-Url: https://www.chiark.greenend.org.uk/ucgi/~ianmdlvl/git?a=commitdiff_plain;h=8fac55d26adec93d155fbc0782eee23f194bef04;p=otter.git special selection: special case for zero Signed-off-by: Ian Jackson --- diff --git a/templates/script.ts b/templates/script.ts index 7e63feac..7b9dda52 100644 --- a/templates/script.ts +++ b/templates/script.ts @@ -465,20 +465,35 @@ function special_count_reupdate() { if (special_count == null) { style_text = ''; } else { - let path = 'stroke-linecap="square" d="M -10 -10 10 10 M 10 -10 -10 10"'; - let svg = + let svg; + let xy; + if (special_count != 0) { + let path = 'stroke-linecap="square" d="M -10 -10 10 10 M 10 -10 -10 10"'; + xy = '15 50'; + svg = ` + viewBox="-15 0 85 65" width="85" height="65"> ${special_count} `; + } else { + let path = 'stroke-linecap="square" d="M -10 -10 0 0 10 -10 M 0 0 0 -20"'; + xy = '15 30'; + svg = +` + + + + `; + } let svg_data = btoa(svg); style_text = `svg[id=space] { - cursor: url(data:image/svg+xml;base64,${svg_data}) 15 50, text; + cursor: url(data:image/svg+xml;base64,${svg_data}) ${xy}, text; }`; } style_elem.innerHTML = style_text;