Commit 470eaa02 authored by Shannon Chen's avatar Shannon Chen Committed by Commit Bot

Round x,y in sendMouseClick

Round x,y coordinates in sendMouseClick so that the caller doesn't need
to take care of rounding.
Signed-off-by: default avatarShannon Chen <shannc@chromium.org>
Bug: None
Change-Id: I0523c6bdb8dea7c77e33285feae4375ea4abd845
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/2514741
Commit-Queue: Shannon Chen <shannc@google.com>
Reviewed-by: default avatarDominic Mazzoni <dmazzoni@chromium.org>
Cr-Commit-Position: refs/heads/master@{#823318}
parent e01d6bfa
......@@ -40,6 +40,11 @@ EventGenerator = class {
}
EventGenerator.currentlyMidMouseClick = true;
// chrome.accessibilityPrivate.sendSyntheticMouseEvent only accepts
// integers.
x = Math.round(x);
y = Math.round(y);
let type = chrome.accessibilityPrivate.SyntheticMouseEventType.PRESS;
chrome.accessibilityPrivate.sendSyntheticMouseEvent({type, x, y});
......
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