(resend) [spice-html5] Add the scroll to the cursor offset

Signed-off-by: Aric Stewart <aric@codeweavers.com>
This commit is contained in:
Aric Stewart 2012-08-16 14:08:05 -05:00 committed by Alon Levy
parent f8f622157c
commit 38ebba8d8a

View File

@ -639,8 +639,8 @@ function SpiceMsgcMousePosition(sc, e)
this.buttons_state = sc.buttons_state;
if (e)
{
this.x = e.clientX - sc.display.surfaces[sc.display.primary_surface].canvas.offsetLeft;
this.y = e.clientY - sc.display.surfaces[sc.display.primary_surface].canvas.offsetTop;
this.x = e.clientX - sc.display.surfaces[sc.display.primary_surface].canvas.offsetLeft + document.body.scrollLeft;
this.y = e.clientY - sc.display.surfaces[sc.display.primary_surface].canvas.offsetTop + document.body.scrollTop;
sc.mousex = this.x;
sc.mousey = this.y;
}