From 38ebba8d8a49904764d52de6fcf7044817835686 Mon Sep 17 00:00:00 2001 From: Aric Stewart Date: Thu, 16 Aug 2012 14:08:05 -0500 Subject: [PATCH] (resend) [spice-html5] Add the scroll to the cursor offset Signed-off-by: Aric Stewart --- spicemsg.js | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/spicemsg.js b/spicemsg.js index 41b001d..79c76bc 100644 --- a/spicemsg.js +++ b/spicemsg.js @@ -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; }