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

Commit 8668e914 authored by TreeHugger Robot's avatar TreeHugger Robot Committed by Android (Google) Code Review
Browse files

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

parents 8f411b99 59b44017
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(