emacs-elpa-diffs
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[elpa] externals/gnugo e2f7c7b 212/357: [gnugo int] Consolidate display


From: Stefan Monnier
Subject: [elpa] externals/gnugo e2f7c7b 212/357: [gnugo int] Consolidate display scaling factors access.
Date: Sun, 29 Nov 2020 14:51:24 -0500 (EST)

branch: externals/gnugo
commit e2f7c7ba7c367589f0fabefb34b18c7605dc2aa2
Author: Thien-Thi Nguyen <ttn@gnu.org>
Commit: Thien-Thi Nguyen <ttn@gnu.org>

    [gnugo int] Consolidate display scaling factors access.
    
    * packages/gnugo/gnugo.el (gnugo-toggle-image-display):
    Save image factors in :imul instead of in :w-imul, :h-imul;
    conditionally assign them directly to :mul instead of :wmul,
    :hmul, or otherwise reset to ‘(1 . 1)’.
    (gnugo-refresh): Update accordingly.
    (gnugo): Init :mul to ‘(1 . 1)’.
---
 gnugo.el | 20 ++++++++++----------
 1 file changed, 10 insertions(+), 10 deletions(-)

diff --git a/gnugo.el b/gnugo.el
index e20bd84..559f71f 100644
--- a/gnugo.el
+++ b/gnugo.el
@@ -494,10 +494,9 @@ when you are sure the command cannot fail."
                                    (setplist yy `(not-yet ,(cdr ent)))
                                    yy))
                                (gnugo-get :xpms))
-                  (let ((imul (image-size (get (gnugo-yy 5 (gnugo-yang ?+))
-                                               'not-yet))))
-                    (gnugo-put :w-imul (car imul))
-                    (gnugo-put :h-imul (cdr imul)))))))
+                  (gnugo-put :imul
+                    (image-size (get (gnugo-yy 5 (gnugo-yang ?+))
+                                     'not-yet)))))))
     (setplist (gnugo-f 'ispc) (and new '(display (space :width 0))))
     (gnugo-put :highlight-last-move-spec
       (if new
@@ -512,8 +511,9 @@ when you are sure the command cannot fail."
     (dolist (group (cdr (assq 'dead (gnugo-get :game-over))))
       (mapc 'delete-overlay (cdar group))
       (setcdr (car group) nil))
-    (gnugo-put :wmul (if new (gnugo-get :w-imul) 1))
-    (gnugo-put :hmul (if new (gnugo-get :h-imul) 1))
+    (gnugo-put :mul (if new
+                        (gnugo-get :imul)
+                      '(1 . 1)))
     (gnugo-put :display-using-images new)))
 
 (defun gnugo-toggle-grid ()
@@ -1480,15 +1480,16 @@ its move."
       (let* ((gridp (not (memq :nogrid buffer-invisibility-spec)))
              (size (gnugo-get :SZ))
              (under10p (< size 10))
+             (mul (gnugo-get :mul))
              (h (- (truncate (- (window-height window)
-                                (* size (gnugo-get :hmul))
+                                (* size (cdr mul))
                                 (if gridp 2 0))
                              2)
                    (if gridp 0 1)))
              (edges (window-edges window))
              (right-w-edge (nth 2 edges))
              (avail-width (- right-w-edge (nth 0 edges)))
-             (wmul (gnugo-get :wmul))
+             (wmul (car mul))
              (imagesp (symbol-plist (gnugo-f 'ispc)))
              (w (/ (- avail-width
                       (* size wmul)
@@ -2531,8 +2532,7 @@ starting a new one.  See `gnugo-board-mode' documentation 
for more info."
                               (gnugo-lsquery "fixed_handicap %d"
                                              handicap)))))))
       (gnugo-put :waiting-start (current-time))
-      (gnugo-put :hmul 1)
-      (gnugo-put :wmul 1)
+      (gnugo-put :mul '(1 . 1))
       (gnugo-refresh t)
       (let ((half (truncate (1+ (gnugo-get :SZ)) 2)))
         (gnugo-goto-pos (format "A%d" half))



reply via email to

[Prev in Thread] Current Thread [Next in Thread]