This commit is contained in:
Alexander Wang 2023-03-14 18:36:16 -07:00
parent b4518cdb03
commit 108b744f3c
No known key found for this signature in database
GPG key ID: D89FA31966BDBECE
13 changed files with 505 additions and 465 deletions

File diff suppressed because one or more lines are too long

Before

Width:  |  Height:  |  Size: 235 KiB

After

Width:  |  Height:  |  Size: 235 KiB

View file

@ -195,11 +195,11 @@
"labelPercentage": 0,
"route": [
{
"x": 43.16666666666667,
"x": 38.66666666666667,
"y": 274
},
{
"x": 43.16666666666667,
"x": 38.66666666666667,
"y": 404
}
],

File diff suppressed because one or more lines are too long

Before

Width:  |  Height:  |  Size: 331 KiB

After

Width:  |  Height:  |  Size: 331 KiB

View file

@ -814,6 +814,14 @@
},
{
"x": 421,
"y": 802
},
{
"x": 444.3333333333333,
"y": 802
},
{
"x": 444.3333333333333,
"y": 942
}
],

File diff suppressed because one or more lines are too long

Before

Width:  |  Height:  |  Size: 341 KiB

After

Width:  |  Height:  |  Size: 341 KiB

View file

@ -1308,6 +1308,14 @@
},
{
"x": 106.5,
"y": 400
},
{
"x": 89.25,
"y": 400
},
{
"x": 89.25,
"y": 590
}
],
@ -1916,6 +1924,14 @@
},
{
"x": 744.5,
"y": 400
},
{
"x": 767,
"y": 400
},
{
"x": 767,
"y": 590
}
],

File diff suppressed because one or more lines are too long

Before

Width:  |  Height:  |  Size: 342 KiB

After

Width:  |  Height:  |  Size: 342 KiB

View file

@ -2082,6 +2082,14 @@
},
{
"x": 366.6666666666667,
"y": 400
},
{
"x": 341.8333333333333,
"y": 400
},
{
"x": 341.8333333333333,
"y": 540
}
],

File diff suppressed because one or more lines are too long

Before

Width:  |  Height:  |  Size: 345 KiB

After

Width:  |  Height:  |  Size: 345 KiB

View file

@ -2570,11 +2570,11 @@
"y": 1338
},
{
"x": 774.8333333333334,
"x": 752.5000000000001,
"y": 1338
},
{
"x": 774.8333333333334,
"x": 752.5000000000001,
"y": 2520
}
],
@ -3023,6 +3023,14 @@
},
{
"x": 1559.1666666666667,
"y": 3518
},
{
"x": 1583.7142857142858,
"y": 3518
},
{
"x": 1583.7142857142858,
"y": 3708
}
],

File diff suppressed because one or more lines are too long

Before

Width:  |  Height:  |  Size: 372 KiB

After

Width:  |  Height:  |  Size: 372 KiB

View file

@ -20,18 +20,18 @@ func NewSegment(from, to *Point) *Segment {
func (s Segment) Overlaps(otherS Segment, isHorizontal bool, buffer float64) bool {
if isHorizontal {
if s.Start.Y-otherS.End.Y >= buffer {
if math.Min(s.Start.Y, s.End.Y)-math.Max(otherS.Start.Y, otherS.End.Y) >= buffer {
return false
}
if otherS.Start.Y-s.End.Y >= buffer {
if math.Min(otherS.Start.Y, otherS.End.Y)-math.Max(s.Start.Y, s.End.Y) >= buffer {
return false
}
return true
} else {
if s.Start.X-otherS.End.X >= buffer {
if math.Min(s.Start.X, s.End.X)-math.Max(otherS.Start.X, otherS.End.X) >= buffer {
return false
}
if otherS.Start.X-s.End.X >= buffer {
if math.Min(otherS.Start.X, otherS.End.X)-math.Max(s.Start.X, s.End.X) >= buffer {
return false
}
return true