From ea00d113ed8077b6f52774ebb2733b0899cdcc05 Mon Sep 17 00:00:00 2001 From: Ian Jackson Date: Wed, 14 Apr 2021 01:27:11 +0100 Subject: [PATCH] drag select: drag, make less funky Signed-off-by: Ian Jackson --- templates/script.ts | 13 +++++++++---- 1 file changed, 9 insertions(+), 4 deletions(-) diff --git a/templates/script.ts b/templates/script.ts index ab61445a..14d1d8f1 100644 --- a/templates/script.ts +++ b/templates/script.ts @@ -1256,10 +1256,15 @@ function rectsel_mousemove(e: MouseEvent) { if (pos2 == null) { path = ""; } else { - path = `M ${ rectsel_start! [0]} ${ rectsel_start! [1] } - ${ pos2 [0]} ${ rectsel_start! [1] } - ${ pos2 [0]} ${ pos2 [1] } - ${ rectsel_start! [0]} ${ pos2 [1] } Z`; + let pos1 = rectsel_start!; + path = `M ${ pos1 [0]} ${ pos1 [1] } + ${ pos2 [0]} ${ pos1 [1] } + M ${ pos1 [0]} ${ pos2 [1] } + ${ pos2 [0]} ${ pos2 [1] } + M ${ pos1 [0]} ${ pos1 [1] } + ${ pos1 [0]} ${ pos2 [1] } + M ${ pos2 [0]} ${ pos1 [1] } + ${ pos2 [0]} ${ pos2 [1] }`; } rectsel_path.firstElementChild!.setAttributeNS(null,'d',path); } -- 2.30.2