Scale mouse coordinates only when the main view has a logical presentation mode set - #625
Merged
Merged
Conversation
Kontrabant
force-pushed
the
logical_scale_fix
branch
2 times, most recently
from
September 17, 2026 16:26
07e624e to
b24bb51
Compare
Kontrabant
force-pushed
the
logical_scale_fix
branch
from
September 17, 2026 16:35
b24bb51 to
215685c
Compare
Contributor
Author
|
Looking more at SDL2, this is definitely the correct fix for the issue, as SDL2 doesn't implicitly scale event values unless the window itself is using a logical presentation mode, and when a render target is attached, the 'backup' logical values are queried, which are equivalent to the "main view" in SDL3. |
…ation mode set When a render target is bound, querying the logical presentation mode will report the presentation mode on the render target, which can differ from the mode set on the main view. When a render target is bound, store the main view logical presentation mode and use it to determine whether mouse coordinates in events should be implicitly scaled, as the main view is always used to transform event coordinates.
Kontrabant
force-pushed
the
logical_scale_fix
branch
from
September 17, 2026 17:04
215685c to
92dba15
Compare
|
Thanks for the quick fix! |
Contributor
Author
|
No problem. Sorry about letting this bug slip through in the first place 🤦♂️. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
When a render target is set, querying the logical presentation mode will report the presentation mode on the render target, which can differ from the main view, and the main view properties are what is used to transform mouse coordinates. When a render target is bound, store the main view presentation mode, and use it to determine whether mouse coordinates in events should be implicitly scaled.
This should be a proper fix for the issue.
Fixes #624 without regressing #606