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: 修复父容器存在 transform 时, 在 canvas 内点击也会重置交互的问题 close #2879 #2942

Merged
merged 1 commit into from
Oct 25, 2024
Merged
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
5 changes: 5 additions & 0 deletions packages/s2-core/src/interaction/event-controller.ts
Original file line number Diff line number Diff line change
Expand Up @@ -206,6 +206,11 @@ export class EventController {
return false;
}

// 开启 CSS transform 时, 降级处理, 不做 canvas 内的空白检测: https://github.com/antvis/S2/issues/2879
if (this.spreadsheet.options.supportCSSTransform) {
return canvas.contains(event.target as HTMLElement);
}

const { x, y } = canvas.getBoundingClientRect() || {};
// 这里不能使用 bounding rect 的 width 和 height, 高清适配后 canvas 实际宽高会变
// 比如实际 400 * 300 => hd (800 * 600)
Expand Down
Loading