mirror of
https://github.com/scratchfoundation/paper.js.git
synced 2025-01-03 19:45:44 -05:00
Prevent mousedown events from disturbing mousenter / mouseleave.
Closes #1069
This commit is contained in:
parent
41e4c622a3
commit
68be3f102e
1 changed files with 4 additions and 2 deletions
|
@ -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
|
// Run the hit-test on items first, but only if we're required to do
|
||||||
// so for this given mouse event, see hitItems, #_countItemEvent():
|
// so for this given mouse event, see hitItems, #_countItemEvent():
|
||||||
var inView = this.getBounds().contains(point),
|
var inView = this.getBounds().contains(point),
|
||||||
hit = inView && hitItems && this._project.hitTest(point, {
|
hit = hitItems && inView && this._project.hitTest(point, {
|
||||||
tolerance: 0,
|
tolerance: 0,
|
||||||
fill: true,
|
fill: true,
|
||||||
stroke: 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
|
// Keep track if view event should be handled, so we can use it
|
||||||
// to decide if tool._handleMouseEvent() shall be called after.
|
// to decide if tool._handleMouseEvent() shall be called after.
|
||||||
handle = false,
|
handle = false,
|
||||||
|
|
Loading…
Reference in a new issue