Commit 3cc74720 authored by Joel Martin's avatar Joel Martin

canvas.js: Fix ignore for scrolled window.

When the documement/window is scrolled, the onMouseDisable routine was
not properly calculating the position to test whether to ignore the
event or not.
parent d67de767
...@@ -357,12 +357,10 @@ function onMouseDisable(e) { ...@@ -357,12 +357,10 @@ function onMouseDisable(e) {
return true; return true;
} }
evt = (e ? e : window.event); evt = (e ? e : window.event);
pos = Util.getPosition(conf.target); pos = Util.getEventPosition(e, conf.target, conf.scale);
/* Stop propagation if inside canvas area */ /* Stop propagation if inside canvas area */
if ((evt.clientX >= pos.x) && if ((pos.x >= 0) && (pos.y >= 0) &&
(evt.clientY >= pos.y) && (pos.x < c_width) && (pos.y < c_height)) {
(evt.clientX < (pos.x + c_width)) &&
(evt.clientY < (pos.y + c_height))) {
//Util.Debug("mouse event disabled"); //Util.Debug("mouse event disabled");
Util.stopEvent(e); Util.stopEvent(e);
return false; return false;
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment