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

Commit 178a1c11 authored by Ruben Brunk's avatar Ruben Brunk
Browse files

Fixed flip (mirror) orientation.

Bug: 7342859
Change-Id: Ic9508927738f64e82e1bd078461b6ee1e1892300
parent a69a86d5
Loading
Loading
Loading
Loading
+10 −0
Original line number Diff line number Diff line
@@ -45,6 +45,11 @@ public class ImageFlip extends ImageGeometry {
        super.setActionDown(x, y);
    }

    boolean hasRotated90(){
        int rot = constrainedRotation(getLocalRotation());
        return ((int) (rot / 90)) % 2 != 0;
    }

    @Override
    protected void setActionMove(float x, float y) {
        super.setActionMove(x, y);
@@ -52,6 +57,11 @@ public class ImageFlip extends ImageGeometry {
        float diffx = mTouchCenterX - x;
        float diffy = mTouchCenterY - y;
        float flick = getScaledMinFlick();
        if(hasRotated90()){
            float temp = diffx;
            diffx = diffy;
            diffy = temp;
        }
        if (Math.abs(diffx) >= flick) {
            // flick moving left/right
            FLIP flip = getLocalFlip();