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

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

[elpa] 03/03: [gnugo int] Consolidate display scaling factors access.


From: Thien-Thi Nguyen
Subject: [elpa] 03/03: [gnugo int] Consolidate display scaling factors access.
Date: Thu, 17 Apr 2014 08:46:47 +0000

ttn pushed a commit to branch master
in repository elpa.

commit 76349a4955e56ccd1eeda80c09ea09cac0234e38
Author: Thien-Thi Nguyen <address@hidden>
Date:   Thu Apr 17 10:48:32 2014 +0200

    [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)’.
---
 packages/gnugo/gnugo.el |   20 ++++++++++----------
 1 files changed, 10 insertions(+), 10 deletions(-)

diff --git a/packages/gnugo/gnugo.el b/packages/gnugo/gnugo.el
index e20bd84..559f71f 100644
--- a/packages/gnugo/gnugo.el
+++ b/packages/gnugo/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]