mirror of
https://github.com/httprunner/httprunner.git
synced 2026-08-28 03:30:01 +08:00
refactor: get window size
This commit is contained in:
@@ -529,10 +529,11 @@ func (dExt *DriverExt) ParseActionOptions(options ...ActionOption) []ActionOptio
|
||||
|
||||
func (dExt *DriverExt) GenAbsScope(x1, y1, x2, y2 float64) AbsScope {
|
||||
// convert relative scope to absolute scope
|
||||
absX1 := int(x1 * float64(dExt.WindowSize.Width))
|
||||
absY1 := int(y1 * float64(dExt.WindowSize.Height))
|
||||
absX2 := int(x2 * float64(dExt.WindowSize.Width))
|
||||
absY2 := int(y2 * float64(dExt.WindowSize.Height))
|
||||
windowSize, _ := dExt.Driver.WindowSize()
|
||||
absX1 := int(x1 * float64(windowSize.Width))
|
||||
absY1 := int(y1 * float64(windowSize.Height))
|
||||
absX2 := int(x2 * float64(windowSize.Width))
|
||||
absY2 := int(y2 * float64(windowSize.Height))
|
||||
return AbsScope{absX1, absY1, absX2, absY2}
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user