eficode / robotframework-imagehorizonlibrary

Cross-platform Robot Framework library for GUI automation based on image recognition
MIT License
80 stars 28 forks source link

Will now detect the screen scaling ratio and adjust #63

Open damies13 opened 2 years ago

damies13 commented 2 years ago

My proposed fix for Issue #62

This update will now detect the screen scaling ratio and adjust accordingly. I tested it using "tests/atest/calculator.robot" on a mac with a Retina display running OSX 12.0.1 I don't have a windows machine to test on, but based on comments in pyautogui issue #589 this should work for the various windows scaling ratios. This replaces the self.has_retina which wasn't working as it was returning false on my machine even though it does indeed have a retina display. __get_pixel_ratio should only get called the first time _locate is called, that was my experience in testing, though perhaps it should be called every time as windows users could potentially change their display scaling during the test. Also I don't know of an OS that supports it now but I guess it's possible in the future an OS may have a scaling factor less than 100% and this change won't support that either.

zoltan-tarko commented 6 months ago

Hi, I found this RFW library quite useful! Thanks for this! :) About this PR. I am really struggling not only with Retina display, but with several different external displays which uses different pixel densities. I see this is a two year old pull request, but it would help me a lot if your PR would be merged. Since no further comment arrived within this 2 years, I would suggest to use your solution, Dave, and go with the

if self.pixel_ratio>0:

Thanks and regard, Zoltan

damies13 commented 6 months ago

Hi Zoltan,

I'm not sure if this library is being maintained? not a single PR I submitted has been used nor any other updates from anyone else. which is sad as I like this Library too,

I just don't have the time to maintain it myself, I have 3 other projects to maintain, other wise I'd fork it and update it. But if someone starts maintaining this library I'd be happy to help fix bugs when I have time.

Dave.