From c13d04c577b4711e1ad717d06b43f7b9bfa253b9 Mon Sep 17 00:00:00 2001 From: kercylan98 Date: Mon, 5 Jun 2023 19:44:06 +0800 Subject: [PATCH] =?UTF-8?q?=E6=A8=AA=E7=BA=BF=E7=9B=B4=E7=BA=BF=E6=90=9C?= =?UTF-8?q?=E7=B4=A2bug=E5=A4=84=E7=90=86?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- utils/g2d/shape.go | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/utils/g2d/shape.go b/utils/g2d/shape.go index 75576c9..0946c70 100644 --- a/utils/g2d/shape.go +++ b/utils/g2d/shape.go @@ -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