CrumbView.java 文件源码

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

项目:crumber 作者:
/**
 * Creates a path array to be used to draw lines
 *
 * @param points nodes which will be concatenate. Points are relative to the view and values between [0,1]
 * @return float array that can be used on both drawing straight or dotted lines
 */
protected float[] createPathArray(List<PointF> points) {
    float[] pathArray = new float[(points.size() - 1) * 4];
    for (int i = 0; i < points.size() - 1; i++) {
        int index = i * 4;

        PointF from = points.get(i);
        pathArray[index] = translateX(from.x);
        pathArray[index + 1] = translateY(from.y);

        PointF to = points.get(i + 1);
        pathArray[index + 2] = translateX(to.x);
        pathArray[index + 3] = translateY(to.y);
    }
    return pathArray;
}
评论列表
文章目录


问题


面经


文章

微信
公众号

扫码关注公众号