Skip to content

Commit

Permalink
Merge pull request #1578 from wakira/fractional-scaling
Browse files Browse the repository at this point in the history
Enable fractional scaling on all platforms
  • Loading branch information
cxxxr authored Oct 25, 2024
2 parents b938a3a + 67fe64e commit f77ca6b
Showing 1 changed file with 6 additions and 7 deletions.
13 changes: 6 additions & 7 deletions frontends/sdl2/main.lisp
Original file line number Diff line number Diff line change
Expand Up @@ -152,15 +152,15 @@
(sdl2:with-window (window :title "Lem"
:w window-width
:h window-height
:flags '(:shown :resizable #+darwin :allow-highdpi))
:flags '(:shown :resizable :allow-highdpi))
(init-application-icon window)
(sdl2:with-renderer (renderer window :index -1 :flags '(:accelerated))
(let* (#+darwin (renderer-size (multiple-value-list
(let* ((renderer-size (multiple-value-list
(sdl2:get-renderer-output-size renderer)))
#+darwin (renderer-width (first renderer-size))
#+darwin(renderer-height (second renderer-size))
(scale-x #-darwin 1 #+darwin (/ renderer-width window-width))
(scale-y #-darwin 1 #+darwin (/ renderer-height window-height))
(renderer-width (first renderer-size))
(renderer-height (second renderer-size))
(scale-x (/ renderer-width window-width))
(scale-y (/ renderer-height window-height))
(texture (lem-sdl2/utils:create-texture renderer
(* scale-x window-width)
(* scale-y window-height)))
Expand All @@ -174,7 +174,6 @@
:char-height (font-char-height font)
:scale (list scale-x scale-y))))
(setf (display:current-display) display)
#+darwin
(display:adapt-high-dpi-font-size display)
(sdl2:start-text-input)
(funcall function)
Expand Down

0 comments on commit f77ca6b

Please sign in to comment.