botcity-framework-core-python icon indicating copy to clipboard operation
botcity-framework-core-python copied to clipboard

Find Coordinates are wrong for MacOS when using a resolution other than default.

Open hhslepicka opened this issue 1 year ago • 1 comments

Describe the bug On MacOS, if using a resolution different than default the find command works properly but the coordinates are wrong as they are calculated based on the default screen resolution and not the one currently in use.

Expected behavior Find works and the coordinates are adjusted to the user's selected monitor resolution.

Steps to Reproduce

  • Configure the resolution to be different than the default for the display
  • Perform a find
  • Move the mouse to the element center
  • Observe that it won't be in the proper location

Possible Solution

My Platform

  • MacOS
  • Display with 4K resolution
  • System set up to half of the display capable resolution

Additional context

$ system_profiler SPDisplaysDataType
Graphics/Displays:

    Apple M2 Pro:

      Chipset Model: Apple M2 Pro
      Type: GPU
      Bus: Built-In
      Total Number of Cores: 19
      Vendor: Apple (0x106b)
      Metal Support: Metal 3
      Displays:
        DELL P2715Q:
          Resolution: 3840 x 2160 (2160p/4K UHD 1 - Ultra High Definition)
          UI Looks like: 1920 x 1080 @ 30.00Hz
          Main Display: Yes
          Mirror: Off
          Online: Yes
          Rotation: Supported
(temp) $ python -c "from botcity.core import DesktopBot; bot = DesktopBot(); print(bot.get_screenshot().size)"
(3840, 2160)

hhslepicka avatar May 24 '24 22:05 hhslepicka

Note: be careful when fix this to not make the bot.display_size() wrong.

hhslepicka avatar May 24 '24 22:05 hhslepicka