Skip to content

Commit 9639e15

Browse files
authored
Merge pull request #43 from XixianLiang/master
fix: some apps will have extra keys in get bounds method and crash
2 parents aa29910 + 9f406e5 commit 9639e15

File tree

1 file changed

+2
-0
lines changed

1 file changed

+2
-0
lines changed

hmdriver2/_uiobject.py

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -182,11 +182,13 @@ def isScrollable(self) -> bool:
182182
@property
183183
def bounds(self) -> Bounds:
184184
_raw = self.__operate("Component.getBounds")
185+
_raw = {k: v for k, v in _raw.items() if k in {"bottom", "left", "right", "top"}}
185186
return Bounds(**_raw)
186187

187188
@property
188189
def boundsCenter(self) -> Point:
189190
_raw = self.__operate("Component.getBoundsCenter")
191+
_raw = {k: v for k, v in _raw.items() if k in {"x", "y"}}
190192
return Point(**_raw)
191193

192194
@property

0 commit comments

Comments
 (0)