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

[patch] Incorrect touch normalization using X11 XInput2 #2913

Closed
SDLBugzilla opened this issue Feb 11, 2021 · 0 comments · Fixed by #8480
Closed

[patch] Incorrect touch normalization using X11 XInput2 #2913

SDLBugzilla opened this issue Feb 11, 2021 · 0 comments · Fixed by #8480

Comments

@SDLBugzilla
Copy link
Collaborator

This bug report was migrated from our old Bugzilla tracker.

These attachments are available in the static archive:

Reported in version: HG 2.0
Reported for operating system, platform: Linux, ARM

Comments on the original bug report:

On 2018-05-31 20:55:10 +0000, Zack Middleton (zturtleman) wrote:

Created attachment 3253
Normalize x11xinput2 touch x to be 1.0 at width

Applications (such as SDL's testgesture) do "event.tfinger.x * window_width" to find window coord. Currently the X11 XInput2 backend expects application to do "event.tfinger.x * (window_width-1)" instead.

X11 XInput2 touch events are normalized so x is 1.0 at "width - 1" but other SDL backends appear to have x be 1.0 at "width". Same issue for touch event y with regards to height.

Related to bug # 3871.

On 2018-06-25 05:49:35 +0000, Ryan C. Gordon wrote:

This patch is now https://hg.libsdl.org/SDL/rev/dfebed374d73, thanks!

--ryan.

On 2018-06-26 22:50:53 +0000, Sam Lantinga wrote:

This is wrong, the other backends should be fixed. Mouse coordinates are 0 based, so at (width,height) they are outside the window.

On 2018-07-02 17:21:06 +0000, Ryan C. Gordon wrote:

I'll back this out for now, then. Sorry!

--ryan.

On 2018-08-03 21:23:10 +0000, Ryan C. Gordon wrote:

This was backed out in https://hg.libsdl.org/SDL/rev/317db3d3712c ; leaving this assigned to me for now.

--ryan.

@slouken slouken removed the bug label May 11, 2022
slouken added a commit to slouken/SDL that referenced this issue Nov 5, 2023
When converting normalized coordinates to pixel coordinates, the valid range is 0 to (width or height) - 1, and the pixel coordinate of width or height is past the edge of the window.

Fixes libsdl-org#2913
slouken added a commit to slouken/SDL that referenced this issue Nov 5, 2023
When converting normalized coordinates to pixel coordinates, the valid range is 0 to (width or height) - 1, and the pixel coordinate of width or height is past the edge of the window.

Fixes libsdl-org#2913
slouken added a commit that referenced this issue Nov 5, 2023
When converting normalized coordinates to pixel coordinates, the valid range is 0 to (width or height) - 1, and the pixel coordinate of width or height is past the edge of the window.

Fixes #2913
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

Successfully merging a pull request may close this issue.

2 participants