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

Commit 29762172 authored by Xiaoqian Dai's avatar Xiaoqian Dai
Browse files

screen capture: fix the RegionBoxButton's position for different cases

Previously, the caption button `RegionBoxButton` was either inside the
selection box or directly on top of it if the box was too small.
The new logic introduces an OutsideLocation enum (TOP, BOTTOM,
LEFT, RIGHT) and a more robust placement strategy:
1. It first checks if the button can fit inside the selection box.
2. If not, it determines the best outside position by checking
available space in a specific order:
* Top: if it fit above the selection box
* Bottom: Otherwise, if it fit below the selection box and the
dimensions pill
* Right: Otherwise, if it fit to the right of the selection box
* Left: If none of the above, it defaults to the left.
This ensures the button remains visible and accessible on the screen,
even when the user draws a selection box near the screen edges.

Bug: 437975890
Test: Manual
Flag: com.android.systemui.large_screen_screencapture

Change-Id: I505166d64b3c6775c8b79ee1b2be9b587fef5142
parent 9f37a591
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