[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))
- [elpa] externals/gnugo 71e1500 245/357: [gnugo] Fix bug: Use ‘gnugo-gate’ for abdication enable., (continued)
- [elpa] externals/gnugo 71e1500 245/357: [gnugo] Fix bug: Use ‘gnugo-gate’ for abdication enable., Stefan Monnier, 2020/11/29
- [elpa] externals/gnugo 46f49e3 246/357: [gnugo int] Use ‘gnugo-current-player’ more., Stefan Monnier, 2020/11/29
- [elpa] externals/gnugo 443903e 249/357: [gnugo int] Drop abstraction: pretty, Stefan Monnier, 2020/11/29
- [elpa] externals/gnugo a0ecdea 257/357: [gnugo] Conditionalize xform warping on abdication disable., Stefan Monnier, 2020/11/29
- [elpa] externals/gnugo 85e3d91 253/357: [gnugo int] Snoop ‘--handicap N’ for empty new board., Stefan Monnier, 2020/11/29
- [elpa] externals/gnugo 7c7d43c 261/357: [gnugo int] Avoid superfluous ‘gnugo-other’ call., Stefan Monnier, 2020/11/29
- [elpa] externals/gnugo 6ddf38f 269/357: [gnugo int] Add abstraction: gnugo--assist-state, Stefan Monnier, 2020/11/29
- [elpa] externals/gnugo d48adca 244/357: [gnugo] On disable, transform in-flight user-move into suggestion., Stefan Monnier, 2020/11/29
- [elpa] externals/gnugo 764251b 259/357: [gnugo int] Fix bug: Use correct color for "Not your turn yet"., Stefan Monnier, 2020/11/29
- [elpa] externals/gnugo 16da062 284/357: [gnugo int] Use ‘loop ... collect’ more., Stefan Monnier, 2020/11/29
- [elpa] externals/gnugo e2f7c7b 212/357: [gnugo int] Consolidate display scaling factors access.,
Stefan Monnier <=
- [elpa] externals/gnugo 2bde4bc 207/357: [gnugo] Add hook: gnugo-start-game-hook, Stefan Monnier, 2020/11/29
- [elpa] externals/gnugo 714d3c9 201/357: [gnugo int] Commentary munging; nfc., Stefan Monnier, 2020/11/29
- [elpa] externals/gnugo e019871 206/357: [gnugo] Add abstraction: gnugo-current-player, Stefan Monnier, 2020/11/29
- [elpa] externals/gnugo 40f7299 225/357: [gnugo] Fix bug: Ensure gametree sync for -l/--infile., Stefan Monnier, 2020/11/29
- [elpa] externals/gnugo cedd448 227/357: [gnugo int] Add abstraction: gnugo--prop<-color, Stefan Monnier, 2020/11/29
- [elpa] externals/gnugo dfe75eb 281/357: [gnugo] Replace ‘gnugo-toggle-image-display-command’ w/ ‘gnugo-image-display-mode’., Stefan Monnier, 2020/11/29
- [elpa] externals/gnugo 88620df 278/357: [gnugo int] Decruft: Drop :local-xpms support., Stefan Monnier, 2020/11/29
- [elpa] externals/gnugo cacb0c7 275/357: [gnugo] Publicize ‘gnugo-undo-reaction’., Stefan Monnier, 2020/11/29
- [elpa] externals/gnugo 48913fd 313/357: [gnugo maint] Update years in copyright notice; nfc., Stefan Monnier, 2020/11/29
- [elpa] externals/gnugo 844189b 308/357: [gnugo] Release: 3.0.0, Stefan Monnier, 2020/11/29