Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Release #1500

Merged
merged 3 commits into from
Aug 22, 2023
Merged

Release #1500

Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 7 additions & 0 deletions packages/g-mobile-canvas/CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,12 @@
# @antv/g-mobile-canvas

## 0.11.1

### Patch Changes

- Updated dependencies [baeafc86]
- @antv/g-plugin-gesture@1.1.1

## 0.11.0

### Minor Changes
Expand Down
2 changes: 1 addition & 1 deletion packages/g-mobile-canvas/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@antv/g-mobile-canvas",
"version": "0.11.0",
"version": "0.11.1",
"description": "A renderer implemented with Canvas2D API in mobile environment",
"keywords": [
"antv",
Expand Down
6 changes: 6 additions & 0 deletions packages/g-plugin-gesture/CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,11 @@
# @antv/g-plugin-gesture

## 1.1.1

### Patch Changes

- baeafc86: fix: move 过程中元素移除,重新获取 target

## 1.1.0

### Minor Changes
Expand Down
2 changes: 1 addition & 1 deletion packages/g-plugin-gesture/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@antv/g-plugin-gesture",
"version": "1.1.0",
"version": "1.1.1",
"description": "A G plugin for Gesture implemented with PointerEvents",
"keywords": [
"antv",
Expand Down
30 changes: 15 additions & 15 deletions packages/g-plugin-gesture/src/GesturePlugin.ts
Original file line number Diff line number Diff line change
Expand Up @@ -221,11 +221,7 @@ export class GesturePlugin implements RenderingPlugin {
this.emitStart(eventType, ev, target);
ev.type = eventType;

if (this.movingTarget) {
this.movingTarget.dispatchEvent(ev);
} else {
target.dispatchEvent(ev);
}
this.refreshAndGetTarget(target).dispatchEvent(ev);

return;
}
Expand All @@ -251,11 +247,7 @@ export class GesturePlugin implements RenderingPlugin {
});
ev.points = points;

if (this.movingTarget) {
this.emitEnd(ev, this.movingTarget);
} else {
this.emitEnd(ev, target);
}
this.emitEnd(ev, this.refreshAndGetTarget(target));

// 单指
if (evCache.length === 1) {
Expand Down Expand Up @@ -309,11 +301,9 @@ export class GesturePlugin implements RenderingPlugin {
return { x: ev.x, y: ev.y };
});
ev.points = points;
if (this.movingTarget) {
this.emitEnd(ev, this.movingTarget);
} else {
this.emitEnd(ev, target);
}

this.emitEnd(ev, this.refreshAndGetTarget(target));

this.evCache = [];
this.reset();
};
Expand Down Expand Up @@ -420,6 +410,16 @@ export class GesturePlugin implements RenderingPlugin {
}
}

private refreshAndGetTarget(target) {
if (this.movingTarget) {
if (this.movingTarget && !this.movingTarget.isConnected) {
this.movingTarget = target;
}
return this.movingTarget;
}
return target;
}

private reset() {
this.clearPressTimeout();
this.startTime = 0;
Expand Down