Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 1b54146d authored by “Longbo's avatar “Longbo Committed by Longbo Wei
Browse files

autoclick: Improve Scroll Panel Positioning

This CL addresses 2 critical issues with the scroll panel positioning
logic

Issues:
1. Inconsistent cursor-to-panel distance
When the cursor is at the top-left or top-right, the panel appears farther away. When it’s at the bottom-left or bottom-right, it appears closer. This inconsistency is caused by incorrect Y-offset calculation that doesn’t account for the status bar height.

2. Panel overlapping with cursor near bottom-left
When the cursor is near the bottom-left corner of the screen, the panel may overlap with the cursor point after repositioning. This overlap may not be visually noticeable, but since the panel still occupies that rectangle space, it can block scroll interactions.

Fixes:
1. Consistent positioning
We now subtract the status bar height when calculating the Y-coordinate to ensure the panel is placed at a consistent distance from the cursor.

2. Avoid overlap
Instead of using a simple placement approach, we now calculate (cursorX ± xOffset, cursorY ± yOffset) as the target center of the panel. From there, we can get the top-left corner (panelX, panelY) and attempt 4 directions to position the panel while avoiding overlap with the cursor point.

Video:
Before: http://shortn/_o6O0mvF4Fo
After:  http://shortn/_fFwqLYmoXy

Bug: b/421239851
Test: atest
Flag: com.android.server.accessibility.enable_autoclick_indicator
Change-Id: Id2e6d25425dafa64dad6024439bf72c04869bec5
parent 484668de
Loading
Loading
Loading
Loading
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment