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

Commit 7573e594 authored by Jeff Brown's avatar Jeff Brown Committed by Gerrit Code Review
Browse files

Merge "Properly rotate full [-pi, +pi] orientation range if available"

parents e2a281ca 70bca4cc
Loading
Loading
Loading
Loading
+8 −4
Original line number Diff line number Diff line
@@ -4170,20 +4170,24 @@ void TouchInputMapper::cookPointerData() {
            x = float(in.y - mRawPointerAxes.y.minValue) * mYScale + mYTranslate;
            y = float(mRawPointerAxes.x.maxValue - in.x) * mXScale + mXTranslate;
            orientation -= M_PI_2;
            if (orientation < - M_PI_2) {
                orientation += M_PI;
            if (orientation < mOrientedRanges.orientation.min) {
                orientation += (mOrientedRanges.orientation.max - mOrientedRanges.orientation.min);
            }
            break;
        case DISPLAY_ORIENTATION_180:
            x = float(mRawPointerAxes.x.maxValue - in.x) * mXScale + mXTranslate;
            y = float(mRawPointerAxes.y.maxValue - in.y) * mYScale + mYTranslate;
            orientation -= M_PI;
            if (orientation < mOrientedRanges.orientation.min) {
                orientation += (mOrientedRanges.orientation.max - mOrientedRanges.orientation.min);
            }
            break;
        case DISPLAY_ORIENTATION_270:
            x = float(mRawPointerAxes.y.maxValue - in.y) * mYScale + mYTranslate;
            y = float(in.x - mRawPointerAxes.x.minValue) * mXScale + mXTranslate;
            orientation += M_PI_2;
            if (orientation > M_PI_2) {
                orientation -= M_PI;
            if (orientation > mOrientedRanges.orientation.max) {
                orientation -= (mOrientedRanges.orientation.max - mOrientedRanges.orientation.min);
            }
            break;
        default: