Skip to content

Commit

Permalink
Release (#1500)
Browse files Browse the repository at this point in the history
* fix: move过程中元素移除,重新获取target (#1497)

Co-authored-by: 兵人 <[email protected]>

* chore: commit changeset

* chore(release): bump version (#1499)

Co-authored-by: github-actions[bot] <github-actions[bot]@users.noreply.github.com>

---------

Co-authored-by: BING <[email protected]>
Co-authored-by: 兵人 <[email protected]>
Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>
Co-authored-by: github-actions[bot] <github-actions[bot]@users.noreply.github.com>
  • Loading branch information
5 people authored Aug 22, 2023
1 parent b288bf2 commit 45b1cd7
Show file tree
Hide file tree
Showing 5 changed files with 30 additions and 17 deletions.
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

0 comments on commit 45b1cd7

Please sign in to comment.