mirror of
https://github.com/httprunner/httprunner.git
synced 2026-05-12 02:21:29 +08:00
change: set the coordinate precision to 1 pixel
This commit is contained in:
@@ -7,8 +7,6 @@ import (
|
||||
"time"
|
||||
|
||||
"github.com/httprunner/funplugin"
|
||||
|
||||
"github.com/httprunner/httprunner/v4/hrp/internal/builtin"
|
||||
)
|
||||
|
||||
var (
|
||||
@@ -438,8 +436,8 @@ type PointF struct {
|
||||
}
|
||||
|
||||
func (p PointF) IsIdentical(p2 PointF) bool {
|
||||
return builtin.IsZeroFloat64(math.Abs(p.X-p2.X)) &&
|
||||
builtin.IsZeroFloat64(math.Abs(p.Y-p2.Y))
|
||||
// set the coordinate precision to 1 pixel
|
||||
return math.Abs(p.X-p2.X) < 1 && math.Abs(p.Y-p2.Y) < 1
|
||||
}
|
||||
|
||||
type Rect struct {
|
||||
|
||||
@@ -483,9 +483,10 @@ func (box Box) IsEmpty() bool {
|
||||
}
|
||||
|
||||
func (box Box) IsIdentical(box2 Box) bool {
|
||||
// set the coordinate precision to 1 pixel
|
||||
return box.Point.IsIdentical(box2.Point) &&
|
||||
builtin.IsZeroFloat64(math.Abs(box.Width-box2.Width)) &&
|
||||
builtin.IsZeroFloat64(math.Abs(box.Height-box2.Height))
|
||||
math.Abs(box.Width-box2.Width) < 1 &&
|
||||
math.Abs(box.Height-box2.Height) < 1
|
||||
}
|
||||
|
||||
func (box Box) Center() PointF {
|
||||
|
||||
Reference in New Issue
Block a user