From 68be3f102e8b82001c7c8700979345be1094a22c Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?J=C3=BCrg=20Lehni?= Date: Sat, 11 Jun 2016 11:14:19 +0200 Subject: [PATCH] Prevent mousedown events from disturbing mousenter / mouseleave. Closes #1069 --- src/view/View.js | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/src/view/View.js b/src/view/View.js index 8af83a90..77304adf 100644 --- a/src/view/View.js +++ b/src/view/View.js @@ -1292,12 +1292,14 @@ new function() { // Injection scope for event handling on the browser // Run the hit-test on items first, but only if we're required to do // so for this given mouse event, see hitItems, #_countItemEvent(): var inView = this.getBounds().contains(point), - hit = inView && hitItems && this._project.hitTest(point, { + hit = hitItems && inView && this._project.hitTest(point, { tolerance: 0, fill: true, stroke: true }), - item = hit && hit.item || undefined, + // If the event doesn't require hit-testing, use the last + // overItem as its current item, for mouseenter / mouseleave. + item = (hitItems ? hit && hit.item : overItem) || undefined, // Keep track if view event should be handled, so we can use it // to decide if tool._handleMouseEvent() shall be called after. handle = false,