PathInterpolatorDonut.java 文件源码

java
阅读 29 收藏 0 点赞 0 评论 0

项目:ShoppingApp 作者:
public PathInterpolatorDonut(Path path) {
    final PathMeasure pathMeasure = new PathMeasure(path, false /* forceClosed */);

    final float pathLength = pathMeasure.getLength();
    final int numPoints = (int) (pathLength / PRECISION) + 1;

    mX = new float[numPoints];
    mY = new float[numPoints];

    final float[] position = new float[2];
    for (int i = 0; i < numPoints; ++i) {
        final float distance = (i * pathLength) / (numPoints - 1);
        pathMeasure.getPosTan(distance, position, null /* tangent */);

        mX[i] = position[0];
        mY[i] = position[1];
    }
}
评论列表
文章目录


问题


面经


文章

微信
公众号

扫码关注公众号