From 3193445aab2405bc9f88a1318091a45e9cc59eaa Mon Sep 17 00:00:00 2001 From: "luchen@google.com" Date: Mon, 12 Jul 2010 19:01:49 +0000 Subject: Fixes a TypeError bug introduced in the picking change. Cannot cancel event propagation if the event is cloned; need to cancel the original event object. Review URL: http://codereview.chromium.org/2962009 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@52115 0039d316-1c4b-4281-b951-d872f2087c98 --- o3d/samples/o3d-webgl/client.js | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) (limited to 'o3d/samples') diff --git a/o3d/samples/o3d-webgl/client.js b/o3d/samples/o3d-webgl/client.js index 877bee4..798ffe3 100644 --- a/o3d/samples/o3d-webgl/client.js +++ b/o3d/samples/o3d-webgl/client.js @@ -823,6 +823,7 @@ o3d.Client.getLocalXY_ = function(eventInfo) { o3d.Client.wrapEventCallback_ = function(handler, doCancelEvent) { return function(event) { event = o3d.Client.getEvent_(event); + var originalEvent = event; var info = o3d.Client.getEventInfo_(event); var relativeCoords = o3d.Client.getLocalXY_(info); // In a proper event, there are read only properties, so we clone it. @@ -833,7 +834,8 @@ o3d.Client.wrapEventCallback_ = function(handler, doCancelEvent) { event.deltaY = -info.wheel; handler(event); if (doCancelEvent) { - o3djs.event.cancel(event); + // Need to cancel the original, un-cloned event. + o3djs.event.cancel(originalEvent); } }; }; -- cgit v1.1