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

Commit faff668b authored by Doris Liu's avatar Doris Liu
Browse files

Fix for camera switcher hard to hit

Bug: 8667079
Change-Id: I9d40617f4e3bcfcd810223d818b212d335c80707
parent d97733b2
Loading
Loading
Loading
Loading
+8 −0
Original line number Diff line number Diff line
@@ -317,6 +317,14 @@ public class PreviewGestures

    private boolean isInside(MotionEvent evt, View v) {
        v.getLocationInWindow(mLocation);
        // when view is flipped horizontally
        if ((int) v.getRotationY() == 180) {
            mLocation[0] -= v.getWidth();
        }
        // when view is flipped vertically
        if ((int) v.getRotationX() == 180) {
            mLocation[1] -= v.getHeight();
        }
        return (v.getVisibility() == View.VISIBLE
                && evt.getX() >= mLocation[0] && evt.getX() < mLocation[0] + v.getWidth()
                && evt.getY() >= mLocation[1] && evt.getY() < mLocation[1] + v.getHeight());