From 3b5d2b789742f1219d6bca12a28487018be2b3d4 Mon Sep 17 00:00:00 2001 From: Ian Jackson Date: Sun, 7 Jun 2020 21:35:22 +0100 Subject: [PATCH] wip non dnd, circle moves properly --- templates/script.js | 8 +++++--- templates/test.html | 5 +++-- 2 files changed, 8 insertions(+), 5 deletions(-) diff --git a/templates/script.js b/templates/script.js index 18becadf..82036065 100644 --- a/templates/script.js +++ b/templates/script.js @@ -2,12 +2,13 @@ // xxx deployment note: need a whole bunch of domains for SSE conn limit -status_node = document.getElementById('spong'); +status_node = document.getElementById('status'); status_node.innerHTML = 'js-done' var our_dnd_type = "text/puvnex-game-server-dummy"; dragthresh = 5; +space = document.getElementById('space'); console.log('foo1'); @@ -24,8 +25,9 @@ function drag_mousedown(e) { } function drag_mousemove(e) { - ddx = e.clientX - dcx; - ddy = e.clientY - dcy; + ctm = space.getScreenCTM(); + ddx = (e.clientX - dcx)/ctm.a; + ddy = (e.clientY - dcy)/ctm.d; if (!dragging) { ddr2 = ddx*ddx + ddy*ddy; if (ddr2 > dragthresh) { diff --git a/templates/test.html b/templates/test.html index dddb28f2..923d38a9 100644 --- a/templates/test.html +++ b/templates/test.html @@ -2,9 +2,10 @@ T -
nothing
+
nothing

- -- 2.30.2