Prevent mousedown events from disturbing mousenter / mouseleave.

Closes #1069
This commit is contained in:
Jürg Lehni 2016-06-11 11:14:19 +02:00
parent 41e4c622a3
commit 68be3f102e

View file

@ -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,