You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
This repository was archived by the owner on Feb 27, 2023. It is now read-only.
Let's consider as an example a window of size 500x500 pixels.
If I manually resize the window used by piksel, the scaling to be used while drawing is adapted automatically, which is amazing 👍 What I means is that if I say to draw a rectangle using rect(0,0,250,250) I will always see a rectangle that takes exactly a quarter of the window.
The only issue I have is with the method mouseMoved. Since it gets called with (x,y) being the position of the mouse in pixels, before resizing the screen the middle of my window corresponds to (250,250), however after manually changing the window size this is no longer true. Note that since the new size of the window is unknown to the class we are writing (at least to my knowledge, I might be wrong!) mouse positions cannot be mapped "properly" on the screen anymore.
I think it would be nice to either:
Change mouseMoved so that it gets called with float parameters (not int). The coordinates should be given already with the new scale factor taken into account. (this would be the best option IMO 😃)
Prevent the window to be scaled (at least as an option, in case we need to handle mouse inputs).
Allow to get the scale factor using a method.
The text was updated successfully, but these errors were encountered:
Let's consider as an example a window of size 500x500 pixels.
If I manually resize the window used by piksel, the scaling to be used while drawing is adapted automatically, which is amazing 👍 What I means is that if I say to draw a rectangle using
rect(0,0,250,250)
I will always see a rectangle that takes exactly a quarter of the window.The only issue I have is with the method
mouseMoved
. Since it gets called with(x,y)
being the position of the mouse in pixels, before resizing the screen the middle of my window corresponds to(250,250)
, however after manually changing the window size this is no longer true. Note that since the new size of the window is unknown to the class we are writing (at least to my knowledge, I might be wrong!) mouse positions cannot be mapped "properly" on the screen anymore.I think it would be nice to either:
mouseMoved
so that it gets called withfloat
parameters (notint
). The coordinates should be given already with the new scale factor taken into account. (this would be the best option IMO 😃)The text was updated successfully, but these errors were encountered: