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
+8 -8
View File
@@ -24,11 +24,11 @@ func (dExt *DriverExt) TapXY(x, y float64, options ...ActionOption) error {
orientation = OrientationPortrait
}
if orientation == OrientationPortrait {
x = x * float64(dExt.windowSize.Width)
y = y * float64(dExt.windowSize.Height)
x = x * float64(dExt.WindowSize.Width)
y = y * float64(dExt.WindowSize.Height)
} else {
x = x * float64(dExt.windowSize.Height)
y = y * float64(dExt.windowSize.Width)
x = x * float64(dExt.WindowSize.Height)
y = y * float64(dExt.WindowSize.Width)
}
return dExt.TapAbsXY(x, y, options...)
}
@@ -105,11 +105,11 @@ func (dExt *DriverExt) DoubleTapXY(x, y float64) error {
orientation = OrientationPortrait
}
if orientation == OrientationPortrait {
x = x * float64(dExt.windowSize.Width)
y = y * float64(dExt.windowSize.Height)
x = x * float64(dExt.WindowSize.Width)
y = y * float64(dExt.WindowSize.Height)
} else {
x = x * float64(dExt.windowSize.Height)
y = y * float64(dExt.windowSize.Width)
x = x * float64(dExt.WindowSize.Height)
y = y * float64(dExt.WindowSize.Width)
}
return dExt.Driver.DoubleTapFloat(x, y)
}