refactor: merge Swipe and SwipeFloat

This commit is contained in:
lilong.129
2024-11-23 22:07:24 +08:00
parent 0b598fa590
commit 89a08f61ec
10 changed files with 11 additions and 43 deletions
+1 -5
View File
@@ -188,11 +188,7 @@ func (hd *hdcDriver) Drag(fromX, fromY, toX, toY float64, options ...ActionOptio
}
// Swipe works like Drag, but `pressForDuration` value is 0
func (hd *hdcDriver) Swipe(fromX, fromY, toX, toY int, options ...ActionOption) error {
return hd.SwipeFloat(float64(fromX), float64(fromY), float64(toX), float64(toY), options...)
}
func (hd *hdcDriver) SwipeFloat(fromX, fromY, toX, toY float64, options ...ActionOption) error {
func (hd *hdcDriver) Swipe(fromX, fromY, toX, toY float64, options ...ActionOption) error {
actionOptions := NewActionOptions(options...)
if len(actionOptions.Offset) == 4 {
fromX += float64(actionOptions.Offset[0])