From a19b19882cd9eff4696d0a081e6fc2f9b95f9c18 Mon Sep 17 00:00:00 2001 From: jamiewalch Date: Fri, 20 Feb 2015 16:42:08 -0800 Subject: [PATCH] Use offsetX and offsetY to position the fake mouse cursor. The mouse cursor element is positioned relative to the document body (ie, ignoring the title bar for apps v2). However, its position was being set using the x and y coordinates of the mouse event, which are relative to the client viewport. This CL fixes this, using offsetX/Y, which are relative to the target element. BUG=410473 Review URL: https://codereview.chromium.org/923013004 Cr-Commit-Position: refs/heads/master@{#317447} --- remoting/webapp/crd/js/desktop_connected_view.js | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/remoting/webapp/crd/js/desktop_connected_view.js b/remoting/webapp/crd/js/desktop_connected_view.js index e4ce2acb0dab..0a14b08e267a 100644 --- a/remoting/webapp/crd/js/desktop_connected_view.js +++ b/remoting/webapp/crd/js/desktop_connected_view.js @@ -79,8 +79,8 @@ remoting.DesktopConnectedView = function(session, container, host, mode, var img = this.mouseCursorOverlay_; /** @param {Event} event @private */ this.updateMouseCursorPosition_ = function(event) { - img.style.top = event.y + 'px'; - img.style.left = event.x + 'px'; + img.style.top = event.offsetY + 'px'; + img.style.left = event.offsetX + 'px'; }; /** @type {number?} @private */ -- 2.11.4.GIT