(improve)TASK:#109167 add touches into series of pan events

This commit is contained in:
wangchangqi 2022-09-28 16:15:08 +08:00
parent de762c7b21
commit 7ea2da2af9
1 changed files with 10 additions and 4 deletions

View File

@ -82,6 +82,7 @@ export interface TripleTapEvent {
* Event: panstart/panmove/panend
*/
export interface PanEvent {
readonly touches?: TouchList // 默认指向当前的触摸列表
readonly startTouches?: TouchList
readonly endTouches?: TouchList
readonly movingTouches?: TouchList
@ -1022,7 +1023,8 @@ export default class GestureDector {
this.emitEvent(
'panstart',
Object.freeze({
movingTouches: evt.changedTouches,
touches: evt.changedTouches,
startTouches: evt.changedTouches,
fingers: evt.touches.length,
})
)
@ -1042,6 +1044,7 @@ export default class GestureDector {
this.emitEvent(
'panmove',
Object.freeze({
touches: evt.changedTouches,
movingTouches: evt.changedTouches,
fingers: evt.touches.length,
absolute: {
@ -1104,6 +1107,7 @@ export default class GestureDector {
this.emitEvent(
'panend',
Object.freeze({
touches: evt.touches,
endTouches: evt.touches,
fingers: evt.touches.length,
velocity: this.vc,
@ -1116,19 +1120,21 @@ export default class GestureDector {
this.emitEvent(
'pan',
Object.freeze({
angle: angle,
direction: direction,
touches: evt.touches,
endTouches: evt.touches,
fingers: evt.touches.length,
angle: angle,
direction: direction,
})
)
} else if (RegExp(direction + '$').test(type)) {
this.emitEvent(
type,
Object.freeze({
angle: angle,
touches: evt.touches,
endTouches: evt.touches,
fingers: evt.touches.length,
angle: angle,
})
)
}