change: DriverExt WindowSize

This commit is contained in:
lilong.129
2024-08-27 20:09:28 +08:00
parent f6ece2e95f
commit 41d4ac4a43
6 changed files with 30 additions and 29 deletions
+4 -4
View File
@@ -22,8 +22,8 @@ func assertRelative(p float64) bool {
}
func (dExt *DriverExt) SwipeUpUtil(count int64, options ...ActionOption) error {
width := dExt.windowSize.Width
height := dExt.windowSize.Height
width := dExt.WindowSize.Width
height := dExt.WindowSize.Height
fromX := float64(width) * directionSlice[count%3][0]
fromY := float64(height) * directionSlice[count%3][1]
@@ -35,8 +35,8 @@ func (dExt *DriverExt) SwipeUpUtil(count int64, options ...ActionOption) error {
// SwipeRelative swipe from relative position [fromX, fromY] to relative position [toX, toY]
func (dExt *DriverExt) SwipeRelative(fromX, fromY, toX, toY float64, options ...ActionOption) error {
width := dExt.windowSize.Width
height := dExt.windowSize.Height
width := dExt.WindowSize.Width
height := dExt.WindowSize.Height
orientation, err := dExt.Driver.Orientation()
if err != nil {
log.Warn().Err(err).Msgf("swipe from (%v, %v) to (%v, %v) get orientation failed, use default orientation",