events: use pointer events to handle mouse events (resolves some conflict with touch events)
Using pointer events everywhere would be ideal but iOS<13 doesn't support them
This commit is contained in:
parent
67226a945a
commit
167d471066
3 changed files with 25 additions and 22 deletions
|
|
@ -109,17 +109,17 @@ class UiSelectArea {
|
|||
|
||||
enable() {
|
||||
|
||||
document.addEventListener('mousedown', this.bindedMousedown)
|
||||
document.addEventListener('mousemove', this.bindedMousemove, true)
|
||||
document.addEventListener('mouseup', this.bindedMouseup)
|
||||
document.addEventListener('pointerdown', this.bindedMousedown)
|
||||
document.addEventListener('pointermove', this.bindedMousemove, true)
|
||||
document.addEventListener('pointerup', this.bindedMouseup)
|
||||
|
||||
}
|
||||
|
||||
disable() {
|
||||
|
||||
document.removeEventListener('mousedown', this.bindedMousedown)
|
||||
document.removeEventListener('mousemove', this.bindedMousemove, true)
|
||||
document.removeEventListener('mouseup', this.bindedMouseup)
|
||||
document.removeEventListener('pointerdown', this.bindedMousedown)
|
||||
document.removeEventListener('pointermove', this.bindedMousemove, true)
|
||||
document.removeEventListener('pointerup', this.bindedMouseup)
|
||||
|
||||
}
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue