From 315610e0a29ba6c19f4f37814daf7205dee57f76 Mon Sep 17 00:00:00 2001 From: "xucong.053" Date: Wed, 9 Nov 2022 15:42:10 +0800 Subject: [PATCH] fix: failed to find text in scope --- hrp/pkg/uixt/ocr_vedem.go | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) diff --git a/hrp/pkg/uixt/ocr_vedem.go b/hrp/pkg/uixt/ocr_vedem.go index 3f456045..1bcc96ad 100644 --- a/hrp/pkg/uixt/ocr_vedem.go +++ b/hrp/pkg/uixt/ocr_vedem.go @@ -179,16 +179,16 @@ func (s *veDEMOCRService) FindText(text string, imageBuf []byte, options ...Data } rects = append(rects, rect) - } - // contains text while not match exactly - if ocrResult.Text != text { - continue - } + // contains text while not match exactly + if ocrResult.Text != text { + continue + } - // match exactly, and not specify index, return the first one - if data.Index == 0 { - return rect, nil + // match exactly, and not specify index, return the first one + if data.Index == 0 { + return rect, nil + } } }