PhasePlane.java 文件源码

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

项目:DirectionFieldAndroid 作者:
public void setPoints(ArrayList<float[]> pointsToPath){
    synchronized (pointsToPath) {
        this.points = pointsToPath;
        float[] startPoint = convertXYToLinePoint(points.get(0));
        path.moveTo(startPoint[0], startPoint[1]);
        for (int i = 0; i<this.points.size(); i++) {
            float[] linePoint = convertXYToLinePoint(points.get(i));
            path.lineTo(linePoint[0],linePoint[1]);
        }
    }
    pathMeasure = new PathMeasure(path, false);
    pathLength = pathMeasure.getLength(); // the interpolated length of the entire path as it would be drawn on the screen in dp
    PathEffect pathEffect = new PathDashPathEffect(makeConvexArrow(15.0f, 15.0f), 5.0f, 0.0f, PathDashPathEffect.Style.ROTATE);
    paintSettings.setPathEffect(pathEffect);
    invalidate();
}
评论列表
文章目录


问题


面经


文章

微信
公众号

扫码关注公众号