fix bug
|
Before Width: | Height: | Size: 235 KiB After Width: | Height: | Size: 235 KiB |
4
e2etests/testdata/stable/circular_dependency/elk/board.exp.json
generated
vendored
|
|
@ -195,11 +195,11 @@
|
|||
"labelPercentage": 0,
|
||||
"route": [
|
||||
{
|
||||
"x": 43.16666666666667,
|
||||
"x": 38.66666666666667,
|
||||
"y": 274
|
||||
},
|
||||
{
|
||||
"x": 43.16666666666667,
|
||||
"x": 38.66666666666667,
|
||||
"y": 404
|
||||
}
|
||||
],
|
||||
|
|
|
|||
|
Before Width: | Height: | Size: 331 KiB After Width: | Height: | Size: 331 KiB |
8
e2etests/testdata/stable/dense/elk/board.exp.json
generated
vendored
|
|
@ -814,6 +814,14 @@
|
|||
},
|
||||
{
|
||||
"x": 421,
|
||||
"y": 802
|
||||
},
|
||||
{
|
||||
"x": 444.3333333333333,
|
||||
"y": 802
|
||||
},
|
||||
{
|
||||
"x": 444.3333333333333,
|
||||
"y": 942
|
||||
}
|
||||
],
|
||||
|
|
|
|||
152
e2etests/testdata/stable/dense/elk/sketch.exp.svg
vendored
|
Before Width: | Height: | Size: 341 KiB After Width: | Height: | Size: 341 KiB |
16
e2etests/testdata/stable/multiple_trees/elk/board.exp.json
generated
vendored
|
|
@ -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
|
||||
}
|
||||
],
|
||||
|
|
|
|||
|
Before Width: | Height: | Size: 342 KiB After Width: | Height: | Size: 342 KiB |
8
e2etests/testdata/stable/n22_e32/elk/board.exp.json
generated
vendored
|
|
@ -2082,6 +2082,14 @@
|
|||
},
|
||||
{
|
||||
"x": 366.6666666666667,
|
||||
"y": 400
|
||||
},
|
||||
{
|
||||
"x": 341.8333333333333,
|
||||
"y": 400
|
||||
},
|
||||
{
|
||||
"x": 341.8333333333333,
|
||||
"y": 540
|
||||
}
|
||||
],
|
||||
|
|
|
|||
152
e2etests/testdata/stable/n22_e32/elk/sketch.exp.svg
vendored
|
Before Width: | Height: | Size: 345 KiB After Width: | Height: | Size: 345 KiB |
12
e2etests/testdata/stable/us_map/elk/board.exp.json
generated
vendored
|
|
@ -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
|
||||
}
|
||||
],
|
||||
|
|
|
|||
152
e2etests/testdata/stable/us_map/elk/sketch.exp.svg
vendored
|
Before Width: | Height: | Size: 372 KiB After Width: | Height: | Size: 372 KiB |
|
|
@ -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
|
||||
|
|
|
|||