mirror of
https://github.com/scratchfoundation/paper.js.git
synced 2025-01-01 02:38:43 -05:00
Handle horizontal lines properly in Line.getSignedDistance()
Closes #546.
This commit is contained in:
parent
ebdc63fbfa
commit
4ab6446e16
1 changed files with 2 additions and 1 deletions
|
@ -166,7 +166,8 @@ var Line = Base.extend(/** @lends Line# */{
|
|||
vx -= px;
|
||||
vy -= py;
|
||||
}
|
||||
// Cache these values since they're used heavily in fatline code
|
||||
if (Numerical.isZero(vx))
|
||||
return x - px;
|
||||
var m = vy / vx, // slope
|
||||
b = py - m * px; // y offset
|
||||
// Distance to the linear equation
|
||||
|
|
Loading…
Reference in a new issue