feat: TapByCV WithTapRandomRect

This commit is contained in:
lilong.129
2025-03-17 18:06:32 +08:00
parent 182de16751
commit 5e2f33b362
5 changed files with 29 additions and 8 deletions
+3 -4
View File
@@ -166,7 +166,7 @@ func (dExt *XTDriver) FindScreenText(text string, opts ...option.ActionOption) (
return textRect, nil
}
func (dExt *XTDriver) FindUIResult(opts ...option.ActionOption) (point ai.PointF, err error) {
func (dExt *XTDriver) FindUIResult(opts ...option.ActionOption) (uiResult ai.UIResult, err error) {
options := option.NewActionOptions(opts...)
if options.ScreenShotFileName == "" {
opts = append(opts, option.WithScreenShotFileName(
@@ -182,11 +182,10 @@ func (dExt *XTDriver) FindUIResult(opts ...option.ActionOption) (point ai.PointF
if err != nil {
return
}
uiResult, err := uiResults.GetUIResult(opts...)
point = uiResult.Center()
uiResult, err = uiResults.GetUIResult(opts...)
log.Info().Interface("text", options.ScreenShotWithUITypes).
Interface("point", point).Msg("FindUIResult success")
Interface("uiResult", uiResult).Msg("FindUIResult success")
return
}