-
Notifications
You must be signed in to change notification settings - Fork 29
Description
Well this is frustrating,
I was trying to set up some basic tests for issues #60 and #61 before I start making changes and I encountered the "retina display issue" when trying to use Click Image
.
Did a little research, and found that the upstream pyautogui is the cause, there is a known issue for this #589 where a workaround is provided so they closed the issue, so it looks like if we want IHL to behave as users would expect then we need to handle it by implementing the workaround.
I also found this issue impacts Windows machines when screen scaling is enabled, while on Mac's the Retina display means the co-ordinates are always double (200%) what they need to be, with windows the scaling factor can vary between 100% and 500% times with typical values being 125%, 150%, 175%, 200%
Fortunately the workaround provided pixelRatio = pyautogui.screenshot().size[0]/pyautogui.size().width
does give us the ratio, so it's a simple matter of dividing the x and y values from pyautogui by the pixelRatio and returning the new co-ordinates.
Also fortunately the workaround doesn't need any additional python modules so it's a minimal impact.
I will submit a fix for this issue soon.