From: Ian Jackson Date: Wed, 14 Apr 2021 00:27:11 +0000 (+0100) Subject: drag select: drag, make less funky X-Git-Tag: otter-0.5.0~77 X-Git-Url: http://www.chiark.greenend.org.uk/ucgi/~ianmdlvl/git?a=commitdiff_plain;h=ea00d113ed8077b6f52774ebb2733b0899cdcc05;p=otter.git drag select: drag, make less funky Signed-off-by: Ian Jackson --- 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); }