Skip to content

sdl2: fix retina mouse coordinates#822

Merged
cxxxr merged 4 commits intolem-project:mainfrom
seanfarley:retina-fix
Jul 7, 2023
Merged

sdl2: fix retina mouse coordinates#822
cxxxr merged 4 commits intolem-project:mainfrom
seanfarley:retina-fix

Conversation

@seanfarley
Copy link
Collaborator

Now that lem has nice retina fonts, let's also add the same for mouse events.

These methods take a raw (x,y) input (in pixels) from sdl2 and multiply
it by the dpi scale (usually 2 for retina screens, otherwise 1) and then
multiply that by the char-{width,height}.
Previously, retina resolution was added to lem for rendering its fonts.
This accidentally skipped over doing the same scaling calculation for
the mouse coordinates so we fix that here.
@cxxxr
Copy link
Member

cxxxr commented Jul 7, 2023

Thank you so much!

@cxxxr cxxxr merged commit e4c30c2 into lem-project:main Jul 7, 2023
@seanfarley seanfarley deleted the retina-fix branch July 7, 2023 16:34
@cxxxr cxxxr mentioned this pull request Jul 11, 2023
6 tasks
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 this pull request may close these issues.

2 participants