(instance: Instance, position: PointerPosition)
| 46 | } |
| 47 | |
| 48 | move(instance: Instance, position: PointerPosition) { |
| 49 | const prevPosition = this.position |
| 50 | const prevTarget = this.getTarget(instance) |
| 51 | |
| 52 | this.position = position |
| 53 | |
| 54 | if (!isDifferentPointerPosition(prevPosition, position)) { |
| 55 | return |
| 56 | } |
| 57 | |
| 58 | const nextTarget = this.getTarget(instance) |
| 59 | |
| 60 | const init = this.getEventInit(-1) |
| 61 | |
| 62 | const [leave, enter] = getTreeDiff(prevTarget, nextTarget) |
| 63 | |
| 64 | return { |
| 65 | leave: () => { |
| 66 | if (hasPointerEvents(instance, prevTarget)) { |
| 67 | if (prevTarget !== nextTarget) { |
| 68 | instance.dispatchUIEvent(prevTarget, 'pointerout', init) |
| 69 | leave.forEach(el => |
| 70 | instance.dispatchUIEvent(el, 'pointerleave', init), |
| 71 | ) |
| 72 | } |
| 73 | } |
| 74 | }, |
| 75 | enter: () => { |
| 76 | assertPointerEvents(instance, nextTarget) |
| 77 | |
| 78 | if (prevTarget !== nextTarget) { |
| 79 | instance.dispatchUIEvent(nextTarget, 'pointerover', init) |
| 80 | enter.forEach(el => |
| 81 | instance.dispatchUIEvent(el, 'pointerenter', init), |
| 82 | ) |
| 83 | } |
| 84 | }, |
| 85 | move: () => { |
| 86 | instance.dispatchUIEvent(nextTarget, 'pointermove', init) |
| 87 | }, |
| 88 | } |
| 89 | } |
| 90 | |
| 91 | down(instance: Instance, button: MouseButton = 0) { |
| 92 | if (this.isDown) { |
nothing calls this directly
no test coverage detected