summaryrefslogtreecommitdiffstats
path: root/webapp/utils/commons.jsx
diff options
context:
space:
mode:
Diffstat (limited to 'webapp/utils/commons.jsx')
-rw-r--r--webapp/utils/commons.jsx18
1 files changed, 1 insertions, 17 deletions
diff --git a/webapp/utils/commons.jsx b/webapp/utils/commons.jsx
index 1888869dc..224653df7 100644
--- a/webapp/utils/commons.jsx
+++ b/webapp/utils/commons.jsx
@@ -8,7 +8,6 @@ export function getDistanceBW2Points(point1, point2, xAttr = 'x', yAttr = 'y') {
*/
export function getNearestPoint(pivotPoint, points, xAttr = 'x', yAttr = 'y') {
var nearestPoint = {};
- var nearestPointLte = {}; // Nearest point smaller than or equal to point
for (const point of points) {
if (typeof nearestPoint[xAttr] === 'undefined' || typeof nearestPoint[yAttr] === 'undefined') {
nearestPoint = point;
@@ -16,21 +15,6 @@ export function getNearestPoint(pivotPoint, points, xAttr = 'x', yAttr = 'y') {
// Check for bestImage
nearestPoint = point;
}
-
- if (typeof nearestPointLte[xAttr] === 'undefined' || typeof nearestPointLte[yAttr] === 'undefined') {
- if (point[xAttr] <= pivotPoint[xAttr] && point[yAttr] <= pivotPoint[yAttr]) {
- nearestPointLte = point;
- }
- } else if (
- // Check for bestImageLte
- getDistanceBW2Points(point, pivotPoint, xAttr, yAttr) < getDistanceBW2Points(nearestPointLte, pivotPoint, xAttr, yAttr) &&
- point[xAttr] <= pivotPoint[xAttr] && point[yAttr] <= pivotPoint[yAttr]
- ) {
- nearestPointLte = point;
- }
}
- return {
- nearestPoint,
- nearestPointLte
- };
+ return nearestPoint;
}