Use frame-monitor-attributes in gamegrid

* lisp/play/gamegrid.el (gamegrid-calculate-glyph-size): Use
`frame-monitor-attributes' to get the frame attributes directly
instead of iterating over `display-monitor-attributes-list'.
This commit is contained in:
Robert Pluim 2022-09-02 11:15:43 +02:00
parent 2ff5763836
commit 865338150e

View file

@ -80,12 +80,8 @@ directory will be used.")
(defun gamegrid-calculate-glyph-size ()
"Calculate appropriate glyph size in pixels based on display resolution.
Return a multiple of 8 no less than 16."
(let (atts
(let ((atts (frame-monitor-attributes))
y-pitch)
(dolist (mon (display-monitor-attributes-list))
(when-let ((frames (alist-get 'frames mon))
(match (memq (selected-frame) frames)))
(setq atts mon)))
(setq y-pitch (cond
(atts
(/ (nth 4 (assq 'geometry atts))