mirror of
https://github.com/httprunner/httprunner.git
synced 2026-05-30 21:09:36 +08:00
merge master
This commit is contained in:
@@ -5,6 +5,7 @@ import (
|
||||
"fmt"
|
||||
"image"
|
||||
"io"
|
||||
"math"
|
||||
"mime/multipart"
|
||||
"net/http"
|
||||
"regexp"
|
||||
@@ -133,6 +134,11 @@ func (t OCRTexts) FindText(text string, options ...ActionOption) (result OCRText
|
||||
}
|
||||
|
||||
results = append(results, ocrText)
|
||||
|
||||
// return the first one matched exactly when index not specified
|
||||
if ocrText.Text == text && actionOptions.Index == 0 {
|
||||
return ocrText, nil
|
||||
}
|
||||
}
|
||||
|
||||
if len(results) == 0 {
|
||||
@@ -468,6 +474,12 @@ func (box Box) IsEmpty() bool {
|
||||
return builtin.IsZeroFloat64(box.Width) && builtin.IsZeroFloat64(box.Height)
|
||||
}
|
||||
|
||||
func (box Box) IsIdentical(box2 Box) bool {
|
||||
return box.Point.IsIdentical(box2.Point) &&
|
||||
builtin.IsZeroFloat64(math.Abs(box.Width-box2.Width)) &&
|
||||
builtin.IsZeroFloat64(math.Abs(box.Height-box2.Height))
|
||||
}
|
||||
|
||||
func (box Box) Center() PointF {
|
||||
return PointF{
|
||||
X: box.Point.X + box.Width*0.5,
|
||||
|
||||
Reference in New Issue
Block a user