From: Ian Jackson Date: Sun, 7 Jun 2020 20:35:22 +0000 (+0100) Subject: wip non dnd, circle moves properly X-Git-Tag: otter-0.2.0~1600 X-Git-Url: https://www.chiark.greenend.org.uk/ucgi/~ianmdlvl/git?a=commitdiff_plain;h=3b5d2b789742f1219d6bca12a28487018be2b3d4;p=otter.git wip non dnd, circle moves properly --- 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

-