mirror of
https://github.com/scratchfoundation/paper.js.git
synced 2025-01-01 02:38:43 -05:00
Simplify vector geometry in Chain example.
This commit is contained in:
parent
1d92aea8e2
commit
d25ab05e25
1 changed files with 2 additions and 2 deletions
|
@ -24,8 +24,8 @@
|
|||
for(var i = 0; i < size - 1; i++) {
|
||||
var nextSegment = segments[i + 1];
|
||||
var position = path.segments[i].point;
|
||||
var angle = (position - nextSegment.point).getAngleInRadians();
|
||||
var vector = new Point(Math.cos(angle), Math.sin(angle)) * -25;
|
||||
var angle = (position - nextSegment.point).angle;
|
||||
var vector = -new Point({ angle: angle, length: 25 });
|
||||
nextSegment.point = position + vector;
|
||||
}
|
||||
path.smooth();
|
||||
|
|
Loading…
Reference in a new issue