mirror of
https://github.com/koodo-reader/koodo-reader.git
synced 2026-10-07 13:22:17 -04:00
fix: update mouse position calculation to use screen coordinates
This commit is contained in:
1 parent
7716286032
commit
da93d3dc09
1 file changed
+2
-5
@@ -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,
|
||||
},
|
||||
})
|
||||
);
|
||||
|
||||
Reference in new issue
Block a user