Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

WindowSize::ScaledPixels doesn't work correctly #49

Open
blaumeise20 opened this issue Jan 1, 2022 · 2 comments
Open

WindowSize::ScaledPixels doesn't work correctly #49

blaumeise20 opened this issue Jan 1, 2022 · 2 comments

Comments

@blaumeise20
Copy link

  1. I would expect windows with a scale factor higher than 1 to automatically scale its content. If you open a website on a retina display, it isn't smaller, but has better resolutions.
  2. For some reason when the window opens on a monitor with scale factor 1 but my main monitor is retina, it is still scaled (has correct size on main monitor, but also has problem 1.)
@QuantumBadger
Copy link
Owner

I would expect windows with a scale factor higher than 1 to automatically scale its content. If you open a website on a retina display, it isn't smaller, but has better resolutions.

What you're describing sounds like the intended behaviour -- Speedy2D's drawing functions work with physical pixels, and it's up to the application to decide how to perform scaling. Speedy2D notifies the application when the scale factor changes, but will not attempt to scale your content automatically or change the size of the window.

Simply multiplying the coordinates by the scaling factor isn't always a sensible thing to do. For example, if the scaling factor is 150%, some lines which were previously pixel-aligned will now be halfway between two pixels, and the result will be blurry. The application may want to handle this more intelligently, e.g. by rounding to an integer number of pixels. Similarly, when drawing images, the application needs to be aware of the real physical resolution of the screen.

For some reason when the window opens on a monitor with scale factor 1 but my main monitor is retina, it is still scaled (has correct size on main monitor, but also has problem 1.)

Could you give more details please? Specifically:

  • Which OS you're using
  • The scale factor of each monitor
  • Are you setting a position when creating the window? I.e. what are the window creation options
  • Which monitor is the window opening on?

@blaumeise20
Copy link
Author

blaumeise20 commented Jan 14, 2022

What you're describing sounds like the intended behaviour

Hmm ok, I unserstand. So that means I have to do calculations by hand, if I understood correctly?

Could you give more details please?

I'm using MacOS 10.15.7.
Also I have 3 monitors, the main integrated retina display in the iMac, and the 3rd monitor is where the window opens.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants