From 5fe1c2357a4f09693274f45f35dfa12367c73c68 Mon Sep 17 00:00:00 2001 From: lijinke666 Date: Fri, 25 Oct 2024 11:28:08 +0800 Subject: [PATCH] =?UTF-8?q?fix:=20=E4=BF=AE=E5=A4=8D=E7=88=B6=E5=AE=B9?= =?UTF-8?q?=E5=99=A8=E5=AD=98=E5=9C=A8=20transform=20=E6=97=B6,=20?= =?UTF-8?q?=E5=9C=A8=20canvas=20=E5=86=85=E7=82=B9=E5=87=BB=E4=B9=9F?= =?UTF-8?q?=E4=BC=9A=E9=87=8D=E7=BD=AE=E4=BA=A4=E4=BA=92=E7=9A=84=E9=97=AE?= =?UTF-8?q?=E9=A2=98=20close=20#2879?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- packages/s2-core/src/interaction/event-controller.ts | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/packages/s2-core/src/interaction/event-controller.ts b/packages/s2-core/src/interaction/event-controller.ts index abcd27f148..318621d1ee 100644 --- a/packages/s2-core/src/interaction/event-controller.ts +++ b/packages/s2-core/src/interaction/event-controller.ts @@ -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)