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

Commit 0cc22288 authored by Seigo Nonaka's avatar Seigo Nonaka
Browse files

Fix coordinate calculation on splitscreen

The mContentRectOnScreen is a global offset i.e. the coordinate is
offset from the display origin. On the other hand, the mScreenRect
always represents a left half of the display in case of horizontally
splitted screen.
So, need to convert the mScreenRect coordinate to the offset from
the display origin.

Bug: 291004451
Test: manually done
Change-Id: I44bed2ee2988f3ce45cc49652946a2832e49ce04
parent 4f300b1f
Loading
Loading
Loading
Loading
+1 −0
Original line number Diff line number Diff line
@@ -222,6 +222,7 @@ public final class FloatingActionMode extends ActionMode {
    private boolean isContentRectWithinBounds() {
        mContext.getDisplayNoVerify().getRealSize(mDisplaySize);
        mScreenRect.set(0, 0, mDisplaySize.x, mDisplaySize.y);
        mScreenRect.offset(mRootViewPositionOnScreen[0], mRootViewPositionOnScreen[1]);

        return intersectsClosed(mContentRectOnScreen, mScreenRect)
            && intersectsClosed(mContentRectOnScreen, mViewRectOnScreen);