mirror of
https://github.com/scratchfoundation/paper.js.git
synced 2025-01-07 13:22:07 -05:00
Rename getEndDistanceSquared() to getSquaredLineLength()
This commit is contained in:
parent
9a148700b7
commit
4eafe808fa
1 changed files with 2 additions and 2 deletions
|
@ -1865,13 +1865,13 @@ new function() { // Scope for intersection using bezier fat-line clipping
|
||||||
// might just have tiny handles within the geometric epsilon
|
// might just have tiny handles within the geometric epsilon
|
||||||
// distance, so we have to check for that too.
|
// distance, so we have to check for that too.
|
||||||
|
|
||||||
function getEndDistanceSquared(v) {
|
function getSquaredLineLength(v) {
|
||||||
var x = v[6] - v[0],
|
var x = v[6] - v[0],
|
||||||
y = v[7] - v[1];
|
y = v[7] - v[1];
|
||||||
return x * x + y * y;
|
return x * x + y * y;
|
||||||
}
|
}
|
||||||
|
|
||||||
var flip = getEndDistanceSquared(v1) < getEndDistanceSquared(v2),
|
var flip = getSquaredLineLength(v1) < getSquaredLineLength(v2),
|
||||||
l1 = flip ? v2 : v1,
|
l1 = flip ? v2 : v1,
|
||||||
l2 = flip ? v1 : v2,
|
l2 = flip ? v1 : v2,
|
||||||
line = new Line(l1[0], l1[1], l1[6], l1[7]);
|
line = new Line(l1[0], l1[1], l1[6], l1[7]);
|
||||||
|
|
Loading…
Reference in a new issue