From e1ba2357ad8afd460fd8a24bff3353b84488b7e8 Mon Sep 17 00:00:00 2001 From: Bob Zeleznik Date: Thu, 14 May 2020 19:34:10 -0400 Subject: added frame animation for colelction views. --- src/client/util/DragManager.ts | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) (limited to 'src/client/util') diff --git a/src/client/util/DragManager.ts b/src/client/util/DragManager.ts index d1d7f2a8a..c997cf744 100644 --- a/src/client/util/DragManager.ts +++ b/src/client/util/DragManager.ts @@ -263,16 +263,16 @@ export namespace DragManager { const denominator = ((y4 - y3) * (x2 - x1) - (x4 - x3) * (y2 - y1)); if (denominator === 0) return undefined; // Lines are parallel - let ua = ((x4 - x3) * (y1 - y3) - (y4 - y3) * (x1 - x3)) / denominator; + const ua = ((x4 - x3) * (y1 - y3) - (y4 - y3) * (x1 - x3)) / denominator; // let ub = ((x2 - x1) * (y1 - y3) - (y2 - y1) * (x1 - x3)) / denominator; //if (ua < 0 || ua > 1 || ub < 0 || ub > 1) return undefined; // is the intersection along the segments // Return a object with the x and y coordinates of the intersection - let x = x1 + ua * (x2 - x1) - let y = y1 + ua * (y2 - y1) + const x = x1 + ua * (x2 - x1); + const y = y1 + ua * (y2 - y1); const dist = Math.sqrt((dragx - x) * (dragx - x) + (dragy - y) * (dragy - y)); - return { pt: [x, y], dist } - } + return { pt: [x, y], dist }; + }; SnappingManager.vertSnapLines().forEach((xCoord, i) => { const pt = intersect(dragPt[0], dragPt[1], dragPt[0] + snapAspect, dragPt[1] + 1, xCoord, -1, xCoord, 1, dragPt[0], dragPt[1]); if (pt && pt.dist < closest) { -- cgit v1.2.3-70-g09d2