mirror of
https://gitee.com/sui-feng-cb/AzurLaneAutoScript1
synced 2026-03-12 01:38:21 +08:00
Fix: [ALAS] DroidCast image orientation on MuMu12
This commit is contained in:
@@ -243,7 +243,7 @@ class Uiautomator2(Connection):
|
||||
return hierarchy
|
||||
|
||||
@retry
|
||||
def resolution_uiautomator2(self) -> t.Tuple[int, int]:
|
||||
def resolution_uiautomator2(self, cal_rotation=True) -> t.Tuple[int, int]:
|
||||
"""
|
||||
Faster u2.window_size(), cause that calls `dumpsys display` twice.
|
||||
|
||||
@@ -252,9 +252,10 @@ class Uiautomator2(Connection):
|
||||
"""
|
||||
info = self.u2.http.get('/info').json()
|
||||
w, h = info['display']['width'], info['display']['height']
|
||||
rotation = self.get_orientation()
|
||||
if (w > h) != (rotation % 2 == 1):
|
||||
w, h = h, w
|
||||
if cal_rotation:
|
||||
rotation = self.get_orientation()
|
||||
if (w > h) != (rotation % 2 == 1):
|
||||
w, h = h, w
|
||||
return w, h
|
||||
|
||||
def resolution_check_uiautomator2(self):
|
||||
|
||||
Reference in New Issue
Block a user