mirror of
https://github.com/scratchfoundation/paper.js.git
synced 2025-01-05 20:32:00 -05:00
Clean up Line#getSide.
This commit is contained in:
parent
7a4c44ec7b
commit
97c8a7cb83
1 changed files with 5 additions and 5 deletions
|
@ -96,14 +96,14 @@ var Line = this.Line = Base.extend({
|
|||
var v1 = this.vector,
|
||||
v2 = point.subtract(this.point),
|
||||
ccw = v2.cross(v1);
|
||||
if (ccw == 0.0) {
|
||||
if (ccw == 0) {
|
||||
ccw = v2.dot(v1);
|
||||
if (ccw > 0.0) {
|
||||
if (ccw > 0) {
|
||||
ccw = (v2 - v1).dot(v1);
|
||||
if (ccw < 0.0)
|
||||
ccw = 0.0;
|
||||
if (ccw < 0)
|
||||
ccw = 0;
|
||||
}
|
||||
}
|
||||
return ccw < 0.0 ? -1 : ccw > 0.0 ? 1 : 0;
|
||||
return ccw < 0 ? -1 : ccw > 0 ? 1 : 0;
|
||||
}
|
||||
});
|
||||
|
|
Loading…
Reference in a new issue