Commit a19b1988 authored by jamiewalch's avatar jamiewalch Committed by Commit bot

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}
parent f16d8d8d
...@@ -79,8 +79,8 @@ remoting.DesktopConnectedView = function(session, container, host, mode, ...@@ -79,8 +79,8 @@ remoting.DesktopConnectedView = function(session, container, host, mode,
var img = this.mouseCursorOverlay_; var img = this.mouseCursorOverlay_;
/** @param {Event} event @private */ /** @param {Event} event @private */
this.updateMouseCursorPosition_ = function(event) { this.updateMouseCursorPosition_ = function(event) {
img.style.top = event.y + 'px'; img.style.top = event.offsetY + 'px';
img.style.left = event.x + 'px'; img.style.left = event.offsetX + 'px';
}; };
/** @type {number?} @private */ /** @type {number?} @private */
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment