mirror of
https://github.com/scratchfoundation/paper.js.git
synced 2025-01-03 19:45:44 -05:00
parent
7c37a4a4d2
commit
0cb792de93
1 changed files with 3 additions and 5 deletions
|
@ -184,11 +184,9 @@ var Line = Base.extend(/** @lends Line# */{
|
|||
}
|
||||
// Based on the error analysis by @iconexperience outlined in
|
||||
// https://github.com/paperjs/paper.js/issues/799
|
||||
return vx === 0
|
||||
? vy >= 0 ? px - x : x - px
|
||||
: vy === 0
|
||||
? vx >= 0 ? y - py : py - y
|
||||
: (vx * (y - py) - vy * (x - px)) / Math.sqrt(vx * vx + vy * vy);
|
||||
return vx === 0 ? vy > 0 ? x - px : px - x
|
||||
: vy === 0 ? vx < 0 ? y - py : py - y
|
||||
: ((x-px) * vy - (y-py) * vx) / Math.sqrt(vx * vx + vy * vy);
|
||||
}
|
||||
}
|
||||
});
|
||||
|
|
Loading…
Reference in a new issue