From: Ian Jackson Date: Wed, 14 Apr 2021 00:22:20 +0000 (+0100) Subject: drag box: Fix box to be a box, still rather funky X-Git-Tag: otter-0.5.0~78 X-Git-Url: http://www.chiark.greenend.org.uk/ucgi/~ianmdlvl/git?a=commitdiff_plain;h=34ebef424c15e8bc2f8d0e0df5fad63f5af0e8cb;p=otter.git drag box: Fix box to be a box, still rather funky Signed-off-by: Ian Jackson --- diff --git a/templates/macros.tera b/templates/macros.tera index 5dfc94da..eaf65f49 100644 --- a/templates/macros.tera +++ b/templates/macros.tera @@ -91,7 +91,7 @@ Hi {{nick | escape}} - + {% endmacro space %} diff --git a/templates/script.ts b/templates/script.ts index efebe0a9..ab61445a 100644 --- a/templates/script.ts +++ b/templates/script.ts @@ -1256,12 +1256,10 @@ function rectsel_mousemove(e: MouseEvent) { if (pos2 == null) { path = ""; } else { - path = "M"; - for (let p of [rectsel_start!, pos2]) { - for (let i of [0,1]) { - path += ` ${ p[i] }`; - } - } + path = `M ${ rectsel_start! [0]} ${ rectsel_start! [1] } + ${ pos2 [0]} ${ rectsel_start! [1] } + ${ pos2 [0]} ${ pos2 [1] } + ${ rectsel_start! [0]} ${ pos2 [1] } Z`; } rectsel_path.firstElementChild!.setAttributeNS(null,'d',path); }