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

Commit c74309bf authored by Matt Casey's avatar Matt Casey Committed by android-build-merger
Browse files

Merge "Reduce floating point error in PerimeterPathGuide." into qt-r1-dev

am: 8668e914

Change-Id: I9d3de5df15afb392ac5a6601257850f66742fc69
parents 3e88e740 8668e914
Loading
Loading
Loading
Loading
+5 −2
Original line number Diff line number Diff line
@@ -287,9 +287,12 @@ public class PerimeterPathGuide {
        float accum = 0;
        for (int i = 0; i < mRegions.length; i++) {
            mRegions[i].normalizedLength = mRegions[i].absoluteLength / perimeterLength;
            accum += mRegions[i].normalizedLength;
            mRegions[i].endCoordinate = accum;
            accum += mRegions[i].absoluteLength;
            mRegions[i].endCoordinate = accum / perimeterLength;
        }
        // Ensure that the last coordinate is 1. Setting it explicitly to avoid floating point
        // error.
        mRegions[mRegions.length - 1].endCoordinate = 1f;
    }

    private CircularCornerPathRenderer.Corner getRotatedCorner(