Fix mousemove position calculation
This commit is contained in:
parent
3b8fc807f7
commit
fab6fb0f5b
@ -106,9 +106,17 @@ class UI {
|
|||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
const rect = this.uiIframe.getBoundingClientRect();
|
||||||
|
const offsets = {
|
||||||
|
top: window.scrollY + rect.top,
|
||||||
|
left: window.scrollX + rect.left
|
||||||
|
};
|
||||||
|
|
||||||
|
|
||||||
const coords = {
|
const coords = {
|
||||||
x: event.pageX - this.uiIframe.offsetLeft,
|
x: event.pageX - offsets.left,
|
||||||
y: event.pageY - this.uiIframe.offsetTop
|
y: event.pageY - offsets.top,
|
||||||
|
frameOffset: offsets,
|
||||||
};
|
};
|
||||||
|
|
||||||
const playerData = this.canShowUI(coords);
|
const playerData = this.canShowUI(coords);
|
||||||
|
Loading…
Reference in New Issue
Block a user