From 3a9a880f2da355833592808be1f6831c34a01e12 Mon Sep 17 00:00:00 2001 From: NateScarlet Date: Sun, 20 Jun 2021 19:19:41 +0800 Subject: [PATCH] fix(adb): handle screen orientation fix #69 --- auto_derby/clients/adb.py | 3 +++ 1 file changed, 3 insertions(+) diff --git a/auto_derby/clients/adb.py b/auto_derby/clients/adb.py index 3dcb64b7..95390e20 100644 --- a/auto_derby/clients/adb.py +++ b/auto_derby/clients/adb.py @@ -68,6 +68,9 @@ def load_size(self): assert match, "unexpected command result: %s" % res self._width = int(match.group(2)) self._height = int(match.group(1)) + if self._width > self._height: + # handle orientation + self._height, self._width = self._width, self._height LOGGER.debug("screen size: width=%d height=%d", self.width, self.height) def setup(self) -> None: