not good but great

プログラミング、アート、映画・本の感想について書きます。

Paper.jsでpathのpositionを使って移動させたら半分だけ動いた

var path = new Path({
	strokeColor: 'red'
});
console.log(path.position);//{ x: 0, y: 0 }

path.add(new Point(30, 75));
console.log(path.position);//{ x: 30, y: 75 }

path.lineTo(new Point(path.position.x + 10, path.position.y + 20));
console.log(path.position);//{ x: 35, y: 85 }

{x:45,y:95}ではないかと思いました。



たぶん点と点を結んだときに、できる直線を長方形と考えて、その中心にpositionは位置しているのかもしれません。長方形の端っこは、{x:45,y:95}に到達しているという感じです。
Paper.js Sketch