Skip to content

Commit 7e9dfde

Browse files
committed
fix(window): correct WindowNotFound issue #271
1 parent 4a6182f commit 7e9dfde

File tree

1 file changed

+4
-4
lines changed

1 file changed

+4
-4
lines changed

lolbot/system/windows/window.py

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -15,8 +15,8 @@ class WindowNotFound(Exception):
1515

1616
def check_window_exists(window_name: str):
1717
if FindWindow(None, window_name) == 0:
18-
return False
19-
raise WindowNotFound
18+
raise WindowNotFound
19+
return True
2020

2121

2222
def get_window_size(window_name: str):
@@ -30,6 +30,6 @@ def get_window_size(window_name: str):
3030

3131
def convert_ratio(ratio: tuple, window_name: str):
3232
x, y, l, h = get_window_size(window_name)
33-
updated_x = (l * ratio[0]) + x
34-
updated_y = (h * ratio[1]) + y
33+
updated_x = ((l - x) * ratio[0]) + x
34+
updated_y = ((h - y) * ratio[1]) + y
3535
return updated_x, updated_y

0 commit comments

Comments
 (0)