横线直线搜索bug处理

This commit is contained in:
kercylan98 2023-06-05 19:44:06 +08:00
parent 540d671d8c
commit c13d04c577
1 changed files with 3 additions and 1 deletions

View File

@ -257,7 +257,9 @@ func SearchNotRepeatStraightLine(minLength int, xys ...[2]int) (result [][][2]in
find[2] = true
points = append(points, [2]int{sx + left, y + top})
}
if len(find) == 2 {
if len(find) == 0 {
points = nil
} else if len(points) >= minLength {
goto end
} else {
points = nil