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 }}
Repository navigation
Pointer position incorrect of canvas is rotated #7175
If the canvas is rotated, then the pointer positions will be calculated incorrectly. In the example below, the pointer should change to the hand cursor if and only if the pointer is over the green square, but it is not the case here.
We will add this information to the documentation, so thanks for highlighting it - we have no intention of changing our input code to handle this though, as there's no logical reason for ever doing this in practice.
The reason we are doing this is that we want to force the orientation of a game to landscape, and allow the game to be in fullscreen mode. So if the player is in portrait mode and the game is in fullscreen, we want to rotate the canvas 90 degrees so that it is in landscape mode, but then the input handling will be incorrect.
Activity
photonstorm commentedon Jun 27, 2025
We will add this information to the documentation, so thanks for highlighting it - we have no intention of changing our input code to handle this though, as there's no logical reason for ever doing this in practice.
leemanhopeter commentedon Jun 29, 2025
The reason we are doing this is that we want to force the orientation of a game to landscape, and allow the game to be in fullscreen mode. So if the player is in portrait mode and the game is in fullscreen, we want to rotate the canvas 90 degrees so that it is in landscape mode, but then the input handling will be incorrect.
What is the recommended way of doing this?
smshuja commentedon Oct 29, 2025
@photonstorm We also have the same issue. The game is loaded in a Webview which is locked in portrait mode and we have no control over it.
Fix pointer position when canvas has CSS transforms (rotate, skew)
Fix pointer position when canvas has CSS transforms (rotate, skew)