From 3cc74720f091800a636c30676d9cd59992490392 Mon Sep 17 00:00:00 2001 From: Joel Martin Date: Tue, 31 Aug 2010 13:36:14 -0500 Subject: [PATCH] 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. --- include/canvas.js | 8 +++----- 1 file changed, 3 insertions(+), 5 deletions(-) diff --git a/include/canvas.js b/include/canvas.js index 13b89f0a..984fcb19 100644 --- a/include/canvas.js +++ b/include/canvas.js @@ -357,12 +357,10 @@ function onMouseDisable(e) { return true; } evt = (e ? e : window.event); - pos = Util.getPosition(conf.target); + pos = Util.getEventPosition(e, conf.target, conf.scale); /* Stop propagation if inside canvas area */ - if ((evt.clientX >= pos.x) && - (evt.clientY >= pos.y) && - (evt.clientX < (pos.x + c_width)) && - (evt.clientY < (pos.y + c_height))) { + if ((pos.x >= 0) && (pos.y >= 0) && + (pos.x < c_width) && (pos.y < c_height)) { //Util.Debug("mouse event disabled"); Util.stopEvent(e); return false;