(improve)TASK:#109167 add touches into series of pan events
This commit is contained in:
parent
de762c7b21
commit
7ea2da2af9
|
@ -82,6 +82,7 @@ export interface TripleTapEvent {
|
||||||
* Event: panstart/panmove/panend
|
* Event: panstart/panmove/panend
|
||||||
*/
|
*/
|
||||||
export interface PanEvent {
|
export interface PanEvent {
|
||||||
|
readonly touches?: TouchList // 默认指向当前的触摸列表
|
||||||
readonly startTouches?: TouchList
|
readonly startTouches?: TouchList
|
||||||
readonly endTouches?: TouchList
|
readonly endTouches?: TouchList
|
||||||
readonly movingTouches?: TouchList
|
readonly movingTouches?: TouchList
|
||||||
|
@ -1022,7 +1023,8 @@ export default class GestureDector {
|
||||||
this.emitEvent(
|
this.emitEvent(
|
||||||
'panstart',
|
'panstart',
|
||||||
Object.freeze({
|
Object.freeze({
|
||||||
movingTouches: evt.changedTouches,
|
touches: evt.changedTouches,
|
||||||
|
startTouches: evt.changedTouches,
|
||||||
fingers: evt.touches.length,
|
fingers: evt.touches.length,
|
||||||
})
|
})
|
||||||
)
|
)
|
||||||
|
@ -1042,6 +1044,7 @@ export default class GestureDector {
|
||||||
this.emitEvent(
|
this.emitEvent(
|
||||||
'panmove',
|
'panmove',
|
||||||
Object.freeze({
|
Object.freeze({
|
||||||
|
touches: evt.changedTouches,
|
||||||
movingTouches: evt.changedTouches,
|
movingTouches: evt.changedTouches,
|
||||||
fingers: evt.touches.length,
|
fingers: evt.touches.length,
|
||||||
absolute: {
|
absolute: {
|
||||||
|
@ -1104,6 +1107,7 @@ export default class GestureDector {
|
||||||
this.emitEvent(
|
this.emitEvent(
|
||||||
'panend',
|
'panend',
|
||||||
Object.freeze({
|
Object.freeze({
|
||||||
|
touches: evt.touches,
|
||||||
endTouches: evt.touches,
|
endTouches: evt.touches,
|
||||||
fingers: evt.touches.length,
|
fingers: evt.touches.length,
|
||||||
velocity: this.vc,
|
velocity: this.vc,
|
||||||
|
@ -1116,19 +1120,21 @@ export default class GestureDector {
|
||||||
this.emitEvent(
|
this.emitEvent(
|
||||||
'pan',
|
'pan',
|
||||||
Object.freeze({
|
Object.freeze({
|
||||||
angle: angle,
|
touches: evt.touches,
|
||||||
direction: direction,
|
|
||||||
endTouches: evt.touches,
|
endTouches: evt.touches,
|
||||||
fingers: evt.touches.length,
|
fingers: evt.touches.length,
|
||||||
|
angle: angle,
|
||||||
|
direction: direction,
|
||||||
})
|
})
|
||||||
)
|
)
|
||||||
} else if (RegExp(direction + '$').test(type)) {
|
} else if (RegExp(direction + '$').test(type)) {
|
||||||
this.emitEvent(
|
this.emitEvent(
|
||||||
type,
|
type,
|
||||||
Object.freeze({
|
Object.freeze({
|
||||||
angle: angle,
|
touches: evt.touches,
|
||||||
endTouches: evt.touches,
|
endTouches: evt.touches,
|
||||||
fingers: evt.touches.length,
|
fingers: evt.touches.length,
|
||||||
|
angle: angle,
|
||||||
})
|
})
|
||||||
)
|
)
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue