|
516 | 516 | function setEventXY (targetObj, pointer, interaction) {
|
517 | 517 | if (!pointer) {
|
518 | 518 | if (interaction.pointerIds.length > 1) {
|
519 |
| - pointer = touchAverage(interaction.pointerMoves); |
| 519 | + pointer = touchAverage(interaction.pointers); |
520 | 520 | }
|
521 | 521 | else {
|
522 |
| - pointer = interaction.pointerMoves[0]; |
| 522 | + pointer = interaction.pointers[0]; |
523 | 523 | }
|
524 | 524 | }
|
525 | 525 |
|
|
1083 | 1083 | };
|
1084 | 1084 |
|
1085 | 1085 | // keep track of added pointers
|
| 1086 | + this.pointers = []; |
1086 | 1087 | this.pointerIds = [];
|
1087 |
| - this.pointerMoves = []; |
1088 | 1088 |
|
1089 | 1089 | // Previous native pointer move event coordinates
|
1090 | 1090 | this.prevCoords = {
|
|
1273 | 1273 | action = this.validateSelector(pointer, matches, matchElements);
|
1274 | 1274 | }
|
1275 | 1275 | else if (target) {
|
1276 |
| - action = validateAction(target.getAction(this.pointerMoves[0], this, this.element), this.target); |
| 1276 | + action = validateAction(target.getAction(this.pointers[0], this, this.element), this.target); |
1277 | 1277 | }
|
1278 | 1278 |
|
1279 | 1279 | if (target && target.options.styleCursor) {
|
|
1848 | 1848 | if (inertia || smoothEnd) {
|
1849 | 1849 | copyCoords(inertiaStatus.upCoords, this.curCoords);
|
1850 | 1850 |
|
1851 |
| - this.pointerMoves[0] = inertiaStatus.startEvent = startEvent = |
| 1851 | + this.pointers[0] = inertiaStatus.startEvent = startEvent = |
1852 | 1852 | new InteractEvent(this, event, this.prepared, 'inertiastart', this.element);
|
1853 | 1853 |
|
1854 | 1854 | inertiaStatus.t0 = now;
|
|
2068 | 2068 | currentElement = this.activeDrops.elements [j],
|
2069 | 2069 | rect = this.activeDrops.rects [j];
|
2070 | 2070 |
|
2071 |
| - validDrops.push(current.dropCheck(this.pointerMoves[0], this.target, dragElement, currentElement, rect) |
| 2071 | + validDrops.push(current.dropCheck(this.pointers[0], this.target, dragElement, currentElement, rect) |
2072 | 2072 | ? currentElement
|
2073 | 2073 | : null);
|
2074 | 2074 | }
|
|
2185 | 2185 | this.inertiaStatus.resumeDx = this.inertiaStatus.resumeDy = 0;
|
2186 | 2186 |
|
2187 | 2187 | this.pointerIds.splice(0);
|
2188 |
| - // pointerMoves should be retained |
2189 |
| - //this.pointerMoves.splice(0); |
| 2188 | + // pointers should be retained |
| 2189 | + //this.pointers.splice(0); |
2190 | 2190 |
|
2191 | 2191 | // delete interaction if it's not the only one
|
2192 | 2192 | if (interactions.length > 1) {
|
|
2270 | 2270 |
|
2271 | 2271 | // move events are kept so that multi-touch properties can still be
|
2272 | 2272 | // calculated at the end of a gesture; use pointerIds index
|
2273 |
| - this.pointerMoves[index] = pointer; |
| 2273 | + this.pointers[index] = pointer; |
2274 | 2274 | }
|
2275 | 2275 | else {
|
2276 |
| - this.pointerMoves[index] = pointer; |
| 2276 | + this.pointers[index] = pointer; |
2277 | 2277 | }
|
2278 | 2278 | },
|
2279 | 2279 |
|
|
2287 | 2287 |
|
2288 | 2288 | // move events are kept so that multi-touch properties can still be
|
2289 | 2289 | // calculated at the end of a GestureEvnt sequence
|
2290 |
| - //this.pointerMoves.splice(index, 1); |
| 2290 | + //this.pointers.splice(index, 1); |
2291 | 2291 | },
|
2292 | 2292 |
|
2293 | 2293 | recordPointer: function (pointer) {
|
2294 | 2294 | // Do not update pointers while inertia is active.
|
2295 |
| - // The inertiastart event should be this.pointerMoves[0] |
| 2295 | + // The inertiastart event should be this.pointers[0] |
2296 | 2296 | if (this.inertiaStatus.active) { return; }
|
2297 | 2297 |
|
2298 | 2298 | var index = this.mouse? 0: indexOf(this.pointerIds, getPointerId(pointer));
|
2299 | 2299 |
|
2300 | 2300 | if (index === -1) { return; }
|
2301 | 2301 |
|
2302 |
| - this.pointerMoves[index] = pointer; |
| 2302 | + this.pointers[index] = pointer; |
2303 | 2303 | },
|
2304 | 2304 |
|
2305 | 2305 | fireTaps: function (pointer, event, targets, elements) {
|
|
2711 | 2711 | // if the element is the interaction element
|
2712 | 2712 | if (element === interaction.element) {
|
2713 | 2713 | // update the interaction's pointer
|
2714 |
| - interaction.removePointer(interaction.pointerMoves[0]); |
| 2714 | + interaction.removePointer(interaction.pointers[0]); |
2715 | 2715 | interaction.addPointer(pointer);
|
2716 | 2716 |
|
2717 | 2717 | return interaction;
|
|
2820 | 2820 | target = interaction.target,
|
2821 | 2821 | snapStatus = interaction.snapStatus,
|
2822 | 2822 | restrictStatus = interaction.restrictStatus,
|
2823 |
| - pointerMoves= interaction.pointerMoves, |
| 2823 | + pointers = interaction.pointers, |
2824 | 2824 | deltaSource = (target && target.options || defaultOptions).deltaSource,
|
2825 | 2825 | sourceX = deltaSource + 'X',
|
2826 | 2826 | sourceY = deltaSource + 'Y',
|
|
2965 | 2965 | }
|
2966 | 2966 | }
|
2967 | 2967 | else if (action === 'gesture') {
|
2968 |
| - this.touches = [pointerMoves[0], pointerMoves[1]]; |
| 2968 | + this.touches = [pointers[0], pointers[1]]; |
2969 | 2969 |
|
2970 | 2970 | if (starting) {
|
2971 |
| - this.distance = touchDistance(pointerMoves, deltaSource); |
2972 |
| - this.box = touchBBox(pointerMoves); |
| 2971 | + this.distance = touchDistance(pointers, deltaSource); |
| 2972 | + this.box = touchBBox(pointers); |
2973 | 2973 | this.scale = 1;
|
2974 | 2974 | this.ds = 0;
|
2975 |
| - this.angle = touchAngle(pointerMoves, undefined, deltaSource); |
| 2975 | + this.angle = touchAngle(pointers, undefined, deltaSource); |
2976 | 2976 | this.da = 0;
|
2977 | 2977 | }
|
2978 | 2978 | else if (ending || event instanceof InteractEvent) {
|
|
2984 | 2984 | this.da = this.angle - interaction.gesture.startAngle;
|
2985 | 2985 | }
|
2986 | 2986 | else {
|
2987 |
| - this.distance = touchDistance(pointerMoves, deltaSource); |
2988 |
| - this.box = touchBBox(pointerMoves); |
| 2987 | + this.distance = touchDistance(pointers, deltaSource); |
| 2988 | + this.box = touchBBox(pointers); |
2989 | 2989 | this.scale = this.distance / interaction.gesture.startDistance;
|
2990 |
| - this.angle = touchAngle(pointerMoves, interaction.gesture.prevAngle, deltaSource); |
| 2990 | + this.angle = touchAngle(pointers, interaction.gesture.prevAngle, deltaSource); |
2991 | 2991 |
|
2992 | 2992 | this.ds = this.scale - interaction.gesture.prevScale;
|
2993 | 2993 | this.da = this.angle - interaction.gesture.prevAngle;
|
|
5015 | 5015 | startCoords : interaction.startCoords,
|
5016 | 5016 |
|
5017 | 5017 | pointerIds : interaction.pointerIds,
|
5018 |
| - pointerMoves : interaction.pointerMoves, |
| 5018 | + pointers : interaction.pointers, |
5019 | 5019 | addPointer : listeners.addPointer,
|
5020 | 5020 | removePointer : listeners.removePointer,
|
5021 | 5021 | recordPointer : listeners.recordPointer,
|
|
0 commit comments