refactor: simplify OCR APIs

This commit is contained in:
lilong.129
2023-04-25 22:27:31 +08:00
parent f9bebf7202
commit 3ec27b9afc
13 changed files with 231 additions and 247 deletions
+4 -6
View File
@@ -17,14 +17,12 @@ func (dExt *DriverExt) DragOffsetFloat(pathname string, toX, toY, xOffset, yOffs
pressForDuration = []float64{1.0}
}
var x, y, width, height float64
if x, y, width, height, err = dExt.FindUIRectInUIKit(pathname); err != nil {
point, err := dExt.FindUIRectInUIKit(pathname)
if err != nil {
return err
}
fromX := x + width*xOffset
fromY := y + height*yOffset
return dExt.Driver.DragFloat(fromX, fromY, toX, toY,
// FIXME: handle offset
return dExt.Driver.DragFloat(point.X+xOffset, point.Y+yOffset, toX, toY,
WithDataPressDuration(pressForDuration[0]))
}