From 34ebef424c15e8bc2f8d0e0df5fad63f5af0e8cb Mon Sep 17 00:00:00 2001 From: Ian Jackson Date: Wed, 14 Apr 2021 01:22:20 +0100 Subject: [PATCH] drag box: Fix box to be a box, still rather funky Signed-off-by: Ian Jackson --- templates/macros.tera | 2 +- templates/script.ts | 10 ++++------ 2 files changed, 5 insertions(+), 7 deletions(-) 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); } -- 2.30.2