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

fix: roam zoom not work in mobile browser #1758

Merged
merged 1 commit into from
Feb 25, 2025
Merged
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
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
{
"changes": [
{
"packageName": "@visactor/vrender-kits",
"comment": "fix: roam zoom not work in mobile browser",
"type": "none"
}
],
"packageName": "@visactor/vrender-kits"
}
10 changes: 7 additions & 3 deletions packages/vrender-kits/src/event/extension/gesture.ts
Original file line number Diff line number Diff line change
Expand Up @@ -158,9 +158,13 @@ export class Gesture extends EventEmitter {
}

private onStart = (ev?: FederatedPointerEvent) => {
this.cachedEvents = [];
this.startPoints = [];
this.reset();
// 双指缩放时, onStart会被触发多次, startPoints负责收集上下文
// 如果onStart时清空startPoints, 会导致onMove提前return, 从而无法触发pinch事件
// 由于onEnd时会清空startPoints, 所以这里暂不清空
// 后续遇到bad case再作处理
// this.cachedEvents = [];
// this.startPoints = [];
// this.reset();

this.startTime = clock.now();

Expand Down
Loading