Skip to content

Commit 2d892b7

Browse files
committed
Rename Interaction pointerMoves array to pointers
1 parent ad33e17 commit 2d892b7

File tree

1 file changed

+23
-23
lines changed

1 file changed

+23
-23
lines changed

interact.js

Lines changed: 23 additions & 23 deletions
Original file line numberDiff line numberDiff line change
@@ -516,10 +516,10 @@
516516
function setEventXY (targetObj, pointer, interaction) {
517517
if (!pointer) {
518518
if (interaction.pointerIds.length > 1) {
519-
pointer = touchAverage(interaction.pointerMoves);
519+
pointer = touchAverage(interaction.pointers);
520520
}
521521
else {
522-
pointer = interaction.pointerMoves[0];
522+
pointer = interaction.pointers[0];
523523
}
524524
}
525525

@@ -1083,8 +1083,8 @@
10831083
};
10841084

10851085
// keep track of added pointers
1086+
this.pointers = [];
10861087
this.pointerIds = [];
1087-
this.pointerMoves = [];
10881088

10891089
// Previous native pointer move event coordinates
10901090
this.prevCoords = {
@@ -1273,7 +1273,7 @@
12731273
action = this.validateSelector(pointer, matches, matchElements);
12741274
}
12751275
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);
12771277
}
12781278

12791279
if (target && target.options.styleCursor) {
@@ -1848,7 +1848,7 @@
18481848
if (inertia || smoothEnd) {
18491849
copyCoords(inertiaStatus.upCoords, this.curCoords);
18501850

1851-
this.pointerMoves[0] = inertiaStatus.startEvent = startEvent =
1851+
this.pointers[0] = inertiaStatus.startEvent = startEvent =
18521852
new InteractEvent(this, event, this.prepared, 'inertiastart', this.element);
18531853

18541854
inertiaStatus.t0 = now;
@@ -2068,7 +2068,7 @@
20682068
currentElement = this.activeDrops.elements [j],
20692069
rect = this.activeDrops.rects [j];
20702070

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)
20722072
? currentElement
20732073
: null);
20742074
}
@@ -2185,8 +2185,8 @@
21852185
this.inertiaStatus.resumeDx = this.inertiaStatus.resumeDy = 0;
21862186

21872187
this.pointerIds.splice(0);
2188-
// pointerMoves should be retained
2189-
//this.pointerMoves.splice(0);
2188+
// pointers should be retained
2189+
//this.pointers.splice(0);
21902190

21912191
// delete interaction if it's not the only one
21922192
if (interactions.length > 1) {
@@ -2270,10 +2270,10 @@
22702270

22712271
// move events are kept so that multi-touch properties can still be
22722272
// calculated at the end of a gesture; use pointerIds index
2273-
this.pointerMoves[index] = pointer;
2273+
this.pointers[index] = pointer;
22742274
}
22752275
else {
2276-
this.pointerMoves[index] = pointer;
2276+
this.pointers[index] = pointer;
22772277
}
22782278
},
22792279

@@ -2287,19 +2287,19 @@
22872287

22882288
// move events are kept so that multi-touch properties can still be
22892289
// calculated at the end of a GestureEvnt sequence
2290-
//this.pointerMoves.splice(index, 1);
2290+
//this.pointers.splice(index, 1);
22912291
},
22922292

22932293
recordPointer: function (pointer) {
22942294
// 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]
22962296
if (this.inertiaStatus.active) { return; }
22972297

22982298
var index = this.mouse? 0: indexOf(this.pointerIds, getPointerId(pointer));
22992299

23002300
if (index === -1) { return; }
23012301

2302-
this.pointerMoves[index] = pointer;
2302+
this.pointers[index] = pointer;
23032303
},
23042304

23052305
fireTaps: function (pointer, event, targets, elements) {
@@ -2711,7 +2711,7 @@
27112711
// if the element is the interaction element
27122712
if (element === interaction.element) {
27132713
// update the interaction's pointer
2714-
interaction.removePointer(interaction.pointerMoves[0]);
2714+
interaction.removePointer(interaction.pointers[0]);
27152715
interaction.addPointer(pointer);
27162716

27172717
return interaction;
@@ -2820,7 +2820,7 @@
28202820
target = interaction.target,
28212821
snapStatus = interaction.snapStatus,
28222822
restrictStatus = interaction.restrictStatus,
2823-
pointerMoves= interaction.pointerMoves,
2823+
pointers = interaction.pointers,
28242824
deltaSource = (target && target.options || defaultOptions).deltaSource,
28252825
sourceX = deltaSource + 'X',
28262826
sourceY = deltaSource + 'Y',
@@ -2965,14 +2965,14 @@
29652965
}
29662966
}
29672967
else if (action === 'gesture') {
2968-
this.touches = [pointerMoves[0], pointerMoves[1]];
2968+
this.touches = [pointers[0], pointers[1]];
29692969

29702970
if (starting) {
2971-
this.distance = touchDistance(pointerMoves, deltaSource);
2972-
this.box = touchBBox(pointerMoves);
2971+
this.distance = touchDistance(pointers, deltaSource);
2972+
this.box = touchBBox(pointers);
29732973
this.scale = 1;
29742974
this.ds = 0;
2975-
this.angle = touchAngle(pointerMoves, undefined, deltaSource);
2975+
this.angle = touchAngle(pointers, undefined, deltaSource);
29762976
this.da = 0;
29772977
}
29782978
else if (ending || event instanceof InteractEvent) {
@@ -2984,10 +2984,10 @@
29842984
this.da = this.angle - interaction.gesture.startAngle;
29852985
}
29862986
else {
2987-
this.distance = touchDistance(pointerMoves, deltaSource);
2988-
this.box = touchBBox(pointerMoves);
2987+
this.distance = touchDistance(pointers, deltaSource);
2988+
this.box = touchBBox(pointers);
29892989
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);
29912991

29922992
this.ds = this.scale - interaction.gesture.prevScale;
29932993
this.da = this.angle - interaction.gesture.prevAngle;
@@ -5015,7 +5015,7 @@
50155015
startCoords : interaction.startCoords,
50165016

50175017
pointerIds : interaction.pointerIds,
5018-
pointerMoves : interaction.pointerMoves,
5018+
pointers : interaction.pointers,
50195019
addPointer : listeners.addPointer,
50205020
removePointer : listeners.removePointer,
50215021
recordPointer : listeners.recordPointer,

0 commit comments

Comments
 (0)