From 2cf9d3c04295835e70c6fad800c7f2062aa9814c Mon Sep 17 00:00:00 2001 From: Jonathan Wilkes <jon.w.wilkes@gmail.com> Date: Fri, 31 Jul 2015 20:58:28 -0400 Subject: [PATCH] fix regression where "mouse" message could give different coords than "mouseup" in same position --- pd/nw/pd_canvas.html | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/pd/nw/pd_canvas.html b/pd/nw/pd_canvas.html index 6ae2d9904..0d6fa9faa 100644 --- a/pd/nw/pd_canvas.html +++ b/pd/nw/pd_canvas.html @@ -71,7 +71,7 @@ var canvas_events = (function() { return false; }, mousedown: function(evt) { - // tk events are one greater than html5... + // tk events (and, therefore, Pd evnets) are one greater than html5... var b = evt.button + 1; var mod; // For some reason right-click sends a modifier value of "8", @@ -94,8 +94,9 @@ var canvas_events = (function() { // evt.pageX + " y: " + evt.pageY + // " button: " + (evt.button + 1)); pdgui.pdsend(name + - " mouseup " + evt.pageX + " " + evt.pageY + " " + - (evt.button + 1)); + " mouseup " + (evt.pageX + svg_view.x) + " " + + (evt.pageY + svg_view.y) + " " + + (evt.button + 1)); evt.stopPropagation(); evt.preventDefault(); }, -- GitLab