mirror of
https://github.com/copy/v86.git
synced 2025-12-31 04:23:15 +00:00
Mouse: Fix case when no screen container is given
This commit is contained in:
parent
73fd991c87
commit
dbf6b65c6b
1 changed files with 7 additions and 4 deletions
|
|
@ -209,10 +209,13 @@ function MouseAdapter(bus, screen_container)
|
|||
|
||||
mouse.bus.send("mouse-delta", [delta_x, delta_y]);
|
||||
|
||||
let absolute_x = e.pageX - screen_container.offsetLeft;
|
||||
let absolute_y = e.pageY - screen_container.offsetTop;
|
||||
mouse.bus.send("mouse-absolute", [
|
||||
absolute_x, absolute_y, screen_container.offsetWidth, screen_container.offsetHeight]);
|
||||
if(screen_container)
|
||||
{
|
||||
let absolute_x = e.pageX - screen_container.offsetLeft;
|
||||
let absolute_y = e.pageY - screen_container.offsetTop;
|
||||
mouse.bus.send("mouse-absolute", [
|
||||
absolute_x, absolute_y, screen_container.offsetWidth, screen_container.offsetHeight]);
|
||||
}
|
||||
}
|
||||
|
||||
function mousedown_handler(e)
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue