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

Commit 2f29e1bb authored by Garfield Tan's avatar Garfield Tan
Browse files

Offset task coordinates from activity layer crops

Current logic uses the boudns of the parent of the activity, but it only
offsets the position of the activity layer. It should also offset the
position of the parent layer.

Bug: 232459537
Test: The final crop state is correct after launching an activity if the
task isn't at the top-left corner.

Change-Id: I3b5d48d1410533a40842870a0164c34c612cc886
parent 2da86beb
Loading
Loading
Loading
Loading
+3 −7
Original line number Diff line number Diff line
@@ -432,14 +432,10 @@ class Transition extends Binder implements BLASTSyncEngine.TransactionReadyListe
                t.setPosition(targetLeash, tmpPos.x, tmpPos.y);
                final Rect clipRect;
                // No need to clip the display in case seeing the clipped content when during the
                // display rotation.
                if (target.asDisplayContent() != null) {
                // display rotation. No need to clip activities because they rely on clipping on
                // task layers.
                if (target.asDisplayContent() != null || target.asActivityRecord() != null) {
                    clipRect = null;
                } else if (target.asActivityRecord() != null) {
                    // Always use parent bounds of activity because letterbox area (e.g. fixed
                    // aspect ratio or size compat mode) should be included.
                    clipRect = target.getParent().getRequestedOverrideBounds();
                    clipRect.offset(-tmpPos.x, -tmpPos.y);
                } else {
                    clipRect = target.getRequestedOverrideBounds();
                    clipRect.offset(-tmpPos.x, -tmpPos.y);