Skip to content

Commit

Permalink
Merge 65be517 into a2c346c
Browse files Browse the repository at this point in the history
  • Loading branch information
ICMI committed Aug 30, 2023
2 parents a2c346c + 65be517 commit 5b6a102
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 17 deletions.
5 changes: 5 additions & 0 deletions .changeset/flat-grapes-remain.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
'@antv/g-plugin-gesture': minor
---

Remove added points during move process.
17 changes: 0 additions & 17 deletions packages/g-plugin-gesture/src/GesturePlugin.ts
Original file line number Diff line number Diff line change
Expand Up @@ -162,7 +162,6 @@ export class GesturePlugin implements RenderingPlugin {

const { x, y, pointerId } = ev;

let isTriggerStart = false;
// Find this event in the cache and update its record with this event
for (let i = 0, len = evCache.length; i < len; i++) {
if (pointerId === evCache[i].pointerId) {
Expand All @@ -172,26 +171,10 @@ export class GesturePlugin implements RenderingPlugin {
y,
ev,
};
isTriggerStart = true;
break;
}
}

// 无触发start事件 需保留startPoints重新触发start
if (!isTriggerStart) {
const point = { x, y };
startPoints.push(point);
evCache.push({
pointerId,
x,
y,
ev,
});
// 目前只处理双指
this.startDistance = calcDistance(startPoints[0], startPoints[1]);
this.center = getCenter(startPoints[0], startPoints[1]);
}

const point = { x, y };
const points = evCache.map((ev) => {
return { x: ev.x, y: ev.y };
Expand Down

0 comments on commit 5b6a102

Please sign in to comment.