Skip to content

Conversation

@sjorsdonkers
Copy link
Contributor

Mouse events can be in the middle of a pixel {x: 1.5, y: 0.5}
NetSurf Dom or our rendered do not support that and just need the pixel where the event happened so we convert it to an integer when we get the value.

@sjorsdonkers sjorsdonkers force-pushed the Subpixel-mouse-events branch from 8c753aa to 2b7a7c0 Compare May 6, 2025 10:45
@krichprollsch
Copy link
Member

What if we set the box size to 2px, will the click be on x: 1, y: 1 instead of 0.5?

@sjorsdonkers
Copy link
Contributor Author

the box size to 2px, will the click be on x: 1, y: 1 instead of 0.5?

x and y are numbers (not integers) according to the spec. So I think it is best to just support them. Initially I thought making them floats internally as well and have the renderer deal with the conversion, but the DOM also expects integers, so I think it is best to just convert them immediately.

@krichprollsch krichprollsch merged commit 921ac18 into main May 6, 2025
12 checks passed
@krichprollsch krichprollsch deleted the Subpixel-mouse-events branch May 6, 2025 13:11
@github-actions github-actions bot locked and limited conversation to collaborators May 6, 2025
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants