mirror of
https://github.com/httprunner/httprunner.git
synced 2026-07-07 15:31:23 +08:00
refactor: use WithRelative to set relative coordinate, absolute by default
This commit is contained in:
@@ -177,7 +177,7 @@ 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.AbsCoordinate {
|
||||
if actionOptions.Relative {
|
||||
fromX, fromY, toX, toY, err = convertToAbsoluteCoordinates(hd, fromX, fromY, toX, toY)
|
||||
if err != nil {
|
||||
return err
|
||||
|
||||
Reference in New Issue
Block a user