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

Cursor size incorrect when scaling #263

Open
Bios-Marcel opened this issue Apr 14, 2021 · 0 comments
Open

Cursor size incorrect when scaling #263

Bios-Marcel opened this issue Apr 14, 2021 · 0 comments
Labels
bug Something isn't working
Milestone

Comments

@Bios-Marcel
Copy link
Member

Bios-Marcel commented Apr 14, 2021

I am somewhat confused as to how I am supposed to scale correctly.
When zooming out, you get more virtual pixels, but the lines won't get any smaller due to the fact the canvas gets bigger as well. Meaning that each line will simply take up more pixels than it would usually. Meaning that not scaling the cursor at all would look correct in this scenario.

Now in the opposite case, if we zoom in, we get less pixels, resulting in having to draw smaller lines. This means the cursor actually has to shrink.

However, not only the zoom factor, but also the backend size of the canvas is relevant for sizing the cursor. However, if you are have a very screen, like a 4k screen, you'll have way more pixels and no zoom. In this scenario, you'll actually run into the problem the mouse cursor can't be correctly sized due to browser virtual limitations.

I don't really know how to solve this with the current way of setting the cursor. The solution could potentially be to manually draw the cursor instead, so that we can get around the limit.

Another option would be to hard-limit the canvas size to 1600x900 virtual pixels. In this case, only downscaling would have to be handled.

@Bios-Marcel Bios-Marcel added the bug Something isn't working label Apr 14, 2021
@Bios-Marcel Bios-Marcel added this to the 1.0.0 milestone Apr 14, 2021
@Bios-Marcel Bios-Marcel changed the title Cursor size incorrect on scaling devices Cursor size incorrect when scaling Apr 15, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

1 participant