change: FindScreenText return text rect

This commit is contained in:
lilong.129
2025-03-17 15:09:04 +08:00
parent 3e7e9b0ef9
commit 7f69052be6
5 changed files with 15 additions and 15 deletions
+2 -5
View File
@@ -86,13 +86,10 @@ func (t OCRText) Size() types.Size {
}
func (t OCRText) Center() PointF {
return getRectangleCenterPoint(t.Rect)
}
func getRectangleCenterPoint(rect image.Rectangle) (point PointF) {
rect := t.Rect
x, y := float64(rect.Min.X), float64(rect.Min.Y)
width, height := float64(rect.Dx()), float64(rect.Dy())
point = PointF{
point := PointF{
X: x + width*0.5,
Y: y + height*0.5,
}