change: convertToAbsolutePoint, convertToAbsoluteCoordinates

This commit is contained in:
lilong.129
2025-03-04 20:02:59 +08:00
parent e35aa782c2
commit 65564b958f
8 changed files with 71 additions and 94 deletions

View File

@@ -177,11 +177,9 @@ func (hd *HDCDriver) Drag(fromX, fromY, toX, toY float64, opts ...option.ActionO
func (hd *HDCDriver) Swipe(fromX, fromY, toX, toY float64, opts ...option.ActionOption) error {
var err error
actionOptions := option.NewActionOptions(opts...)
if actionOptions.Relative {
fromX, fromY, toX, toY, err = convertToAbsoluteCoordinates(hd, fromX, fromY, toX, toY)
if err != nil {
return err
}
fromX, fromY, toX, toY, err = convertToAbsoluteCoordinates(hd, fromX, fromY, toX, toY)
if err != nil {
return err
}
duration := 200