From 9e064ee0adf16c716b4b8b00439c29eb7946a2e2 Mon Sep 17 00:00:00 2001 From: "lilong.129" Date: Wed, 5 Mar 2025 10:43:26 +0800 Subject: [PATCH] fix: screenshot with path --- internal/version/VERSION | 2 +- pkg/uixt/android_driver_uia2.go | 2 +- pkg/uixt/driver_ext_screenshot.go | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/internal/version/VERSION b/internal/version/VERSION index df0705ec..821cd170 100644 --- a/internal/version/VERSION +++ b/internal/version/VERSION @@ -1 +1 @@ -v5.0.0+2503042040 +v5.0.0+2503051043 diff --git a/pkg/uixt/android_driver_uia2.go b/pkg/uixt/android_driver_uia2.go index 71cf1cad..9aac96e9 100644 --- a/pkg/uixt/android_driver_uia2.go +++ b/pkg/uixt/android_driver_uia2.go @@ -254,11 +254,11 @@ func (ud *UIA2Driver) Orientation() (orientation types.Orientation, err error) { func (ud *UIA2Driver) DoubleTap(x, y float64, opts ...option.ActionOption) error { var err error - actionOptions := option.NewActionOptions(opts...) x, y, err = convertToAbsolutePoint(ud, x, y) if err != nil { return err } + actionOptions := option.NewActionOptions(opts...) x, y = actionOptions.ApplyOffset(x, y) data := map[string]interface{}{ diff --git a/pkg/uixt/driver_ext_screenshot.go b/pkg/uixt/driver_ext_screenshot.go index 94809f21..66962fe7 100644 --- a/pkg/uixt/driver_ext_screenshot.go +++ b/pkg/uixt/driver_ext_screenshot.go @@ -69,7 +69,7 @@ func (dExt *XTDriver) GetScreenResult(opts ...option.ActionOption) (screenResult // get screenshot info with retry for i := 0; i < 3; i++ { imagePath = filepath.Join(config.GetConfig().ScreenShotsPath, fileName) - bufSource, err = dExt.ScreenShot() + bufSource, err = dExt.ScreenShot(option.WithScreenShotFileName(imagePath)) if err != nil { lastErr = err continue