Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
D
drawing-app
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Model registry
Operate
Environments
Monitor
Incidents
Service Desk
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
GitLab community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
sweng-group-15
drawing-app
Merge requests
!48
Intuitive erasing
Code
Review changes
Check out branch
Download
Patches
Plain diff
Expand sidebar
Merged
Intuitive erasing
intuitive-erasing
into
master
Overview
23
Commits
26
Pipelines
12
Changes
1
1 open thread
Thread options
Hide all comments
Merged
Intuitive erasing
Iurii Maksymets
requested to merge
intuitive-erasing
into
master
Oct 31, 2019
Overview
23
Commits
26
Pipelines
12
Changes
1
1 open thread
Thread options
Hide all comments
Closes
!49 (closed)
.
Edited
Nov 1, 2019
by
Nayeem Rahman
0
1
Merge request reports
Viewing commit
ccb7c4b5
Prev
Next
Show latest version
1 file
+
3
−
3
Inline
Compare changes
Side-by-side
Inline
Show whitespace changes
Show one file at a time
ccb7c4b5
Comply to new ESLint rules
· ccb7c4b5
Yuriy Maksymets
authored
Oct 31, 2019
src/erasure.js
+
3
−
3
View file @ ccb7c4b5
Edit in single-file editor
Open in Web IDE
Show full file
@@ -19,9 +19,9 @@ function cap01(x) {
}
function
distToSegmentSquared
(
lineStart
,
lineEnd
,
point
)
{
var
l2
=
distanceSquared
(
lineStart
,
lineEnd
)
const
l2
=
distanceSquared
(
lineStart
,
lineEnd
)
if
(
l2
===
0
)
return
distanceSquared
(
point
,
lineStart
)
var
t
=
let
t
=
((
point
[
0
]
-
lineStart
[
0
])
*
(
lineEnd
[
0
]
-
lineStart
[
0
])
+
(
point
[
1
]
-
lineStart
[
1
])
*
(
lineEnd
[
1
]
-
lineStart
[
1
]))
/
l2
@@ -100,7 +100,7 @@ function mergeIntervals(...intervals) {
if
(
!
intervals
.
length
)
return
[]
const
sorted
=
intervals
.
sort
(([
a
],
[
b
])
=>
a
>
b
)
le
t
stack
=
[
sorted
[
0
]]
cons
t
stack
=
[
sorted
[
0
]]
sorted
.
forEach
((
x
)
=>
{
const
top
=
stack
[
stack
.
length
-
1
]
if
(
overlaps
(
x
,
top
))
{
Loading