Commit 0bdd04ef authored by Jeonghee Ahn's avatar Jeonghee Ahn Committed by Commit Bot

[SpatNav] Fix fake mouse hover coordinates

Fixed bug where adjacent elements were incorrectly get HOVER.

The left-top position of an element is not perfect coordinates for fake mouse hover.
So I added 1 pixel.
I'm not sure this solution is correct for all cases.
But, I can't leave this bug.

If there is a better way, please guide me.

Bug: 982187
Change-Id: I60501ffeb07baba85e97e52fa9a4c69cea7ca1d0
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/1782206Reviewed-by: default avatarDavid Bokan <bokan@chromium.org>
Commit-Queue: Jeonghee Ahn <jeonghee27.ahn@lge.com>
Cr-Commit-Position: refs/heads/master@{#698414}
parent 9ad88042
......@@ -96,7 +96,6 @@ static void ConsiderForBestCandidate(SpatialNavigationDirection direction,
if (distance == kMaxDistance)
return;
if (distance < *best_distance && IsUnobscured(candidate)) {
*best_candidate = candidate;
*best_distance = distance;
......@@ -466,8 +465,11 @@ void SpatialNavigationController::MoveInterestTo(Node* next_node) {
}
void SpatialNavigationController::DispatchMouseMoveAt(Element* element) {
FloatPoint event_position =
element ? RectInViewport(*element).Location() : FloatPoint(-1, -1);
FloatPoint event_position(-1, -1);
if (element) {
event_position = RectInViewport(*element).Location();
event_position.Move(1, 1);
}
// TODO(bokan): Can we get better screen coordinates?
FloatPoint event_position_screen = event_position;
......
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