fix: update mouse position calculation to use screen coordinates

This commit is contained in:
troyeguo committed 2026-07-13 18:04:54 +08:00
1 parent 7716286032
commit da93d3dc09
1 file changed
+2 -5
+2 -5
View File
@@ -455,14 +455,11 @@ export const bindHtmlEvent = (
);
doc.addEventListener("mousemove", (event: any) => {
const iframe = getIframeWin();
if (!iframe) return;
const rect = iframe.getBoundingClientRect();
window.dispatchEvent(
new CustomEvent(MOUSE_POSITION_EVENT, {
detail: {
clientX: rect.left + event.clientX,
clientY: rect.top + event.clientY,
clientX: event.screenX - window.screenX,
clientY: event.screenY - window.screenY,
},
})
);