Skip to content
Snippets Groups Projects
Commit ccb7c4b5 authored by Yuriy Maksymets's avatar Yuriy Maksymets
Browse files

Comply to new ESLint rules

parent bf07570a
No related branches found
No related tags found
2 merge requests!57Erasure intervals,!48Intuitive erasing
Pipeline #103561 passed
...@@ -19,9 +19,9 @@ function cap01(x) { ...@@ -19,9 +19,9 @@ function cap01(x) {
} }
function distToSegmentSquared(lineStart, lineEnd, point) { function distToSegmentSquared(lineStart, lineEnd, point) {
var l2 = distanceSquared(lineStart, lineEnd) const l2 = distanceSquared(lineStart, lineEnd)
if (l2 === 0) return distanceSquared(point, lineStart) if (l2 === 0) return distanceSquared(point, lineStart)
var t = let t =
((point[0] - lineStart[0]) * (lineEnd[0] - lineStart[0]) + ((point[0] - lineStart[0]) * (lineEnd[0] - lineStart[0]) +
(point[1] - lineStart[1]) * (lineEnd[1] - lineStart[1])) / (point[1] - lineStart[1]) * (lineEnd[1] - lineStart[1])) /
l2 l2
...@@ -100,7 +100,7 @@ function mergeIntervals(...intervals) { ...@@ -100,7 +100,7 @@ function mergeIntervals(...intervals) {
if (!intervals.length) return [] if (!intervals.length) return []
const sorted = intervals.sort(([a], [b]) => a > b) const sorted = intervals.sort(([a], [b]) => a > b)
let stack = [sorted[0]] const stack = [sorted[0]]
sorted.forEach((x) => { sorted.forEach((x) => {
const top = stack[stack.length - 1] const top = stack[stack.length - 1]
if (overlaps(x, top)) { if (overlaps(x, top)) {
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment