[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[elpa] 170/255: fix spacing of labels when using image for display
From: |
Eric Schulte |
Subject: |
[elpa] 170/255: fix spacing of labels when using image for display |
Date: |
Sun, 16 Mar 2014 01:02:42 +0000 |
eschulte pushed a commit to branch go
in repository elpa.
commit 696daf8808cf4f9d9b426c6410b4382624df93f7
Author: Eric Schulte <address@hidden>
Date: Tue Jun 5 23:17:37 2012 -0600
fix spacing of labels when using image for display
---
go-board.el | 28 ++++++++++++++++++----------
1 files changed, 18 insertions(+), 10 deletions(-)
diff --git a/go-board.el b/go-board.el
index 448e0c1..515552f 100644
--- a/go-board.el
+++ b/go-board.el
@@ -153,14 +153,17 @@
;;; Visualization
(defun board-header (board)
- (let ((size (board-size board)))
- (concat " "
- (mapconcat (lambda (n)
- (let ((char (+ ?A n)))
- (when (>= char ?I)
- (setq char (+ 1 char)))
- (string char)))
- (range size) " "))))
+ (flet ((hd (str hd)
+ (put-text-property 0 1 :type `(,hd . :offboard) str)
+ str))
+ (let ((size (board-size board)))
+ (concat " "
+ (hd " " :filler)
+ (mapconcat (lambda (n)
+ (let ((char (+ ?A n)))
+ (when (>= char ?I) (setq char (+ 1 char)))
+ (hd (string char) :header)))
+ (range size) (hd " " :filler))))))
(defun board-pos-to-string (board pos)
(let ((size (board-size board)))
@@ -231,7 +234,9 @@
(overlay-put ovly 'face (sym-cat 'go-board face))
(when go-board-use-images
(overlay-put ovly 'display
- (eval (sym-cat 'go-board 'image face back))))
+ (if (equal face 'filler)
+ '(space :width (18))
+ (eval (sym-cat 'go-board 'image face back)))))
(push ovly *go-board-overlays*)))
(hide (point)
(let ((ovly (make-overlay point (1+ point))))
@@ -248,8 +253,11 @@
(:t 'top)
(:b 'bottom)
(:l 'left)
- (:r 'right))))
+ (:r 'right)
+ (:offboard 'offboard))))
(case (car (get-text-property point :type))
+ (:header nil)
+ (:filler (ov point 'filler back))
(:hoshi (ov point 'hoshi))
(:white (ov point 'white back))
(:black (ov point 'black back))
- [elpa] 162/255: painting a nice svg board, but more to do, (continued)
- [elpa] 162/255: painting a nice svg board, but more to do, Eric Schulte, 2014/03/15
- [elpa] 159/255: translated all svg stone images into elisp, Eric Schulte, 2014/03/15
- [elpa] 164/255: prompt before quitting, Eric Schulte, 2014/03/15
- [elpa] 153/255: safety measure when observing igs games, Eric Schulte, 2014/03/15
- [elpa] 163/255: sorted out different types of backgrounds, Eric Schulte, 2014/03/15
- [elpa] 168/255: adding option to play a sound during moves, Eric Schulte, 2014/03/15
- [elpa] 155/255: less permissive igs move regular expression, Eric Schulte, 2014/03/15
- [elpa] 166/255: board images working with backgrounds, Eric Schulte, 2014/03/15
- [elpa] 173/255: start gnugo process when object is created, Eric Schulte, 2014/03/15
- [elpa] 167/255: cleanup images in board faces, Eric Schulte, 2014/03/15
- [elpa] 170/255: fix spacing of labels when using image for display,
Eric Schulte <=
- [elpa] 174/255: quit the main back-end as well, Eric Schulte, 2014/03/15
- [elpa] 160/255: removing stones/ directory, Eric Schulte, 2014/03/15
- [elpa] 175/255: support for playing different types of games, Eric Schulte, 2014/03/15
- [elpa] 157/255: images of stones, Eric Schulte, 2014/03/15
- [elpa] 177/255: future tasks, Eric Schulte, 2014/03/15
- [elpa] 182/255: reverse order of sizes, Eric Schulte, 2014/03/15
- [elpa] 172/255: re-organized how files are loaded, Eric Schulte, 2014/03/15
- [elpa] 156/255: chunking responses from IGS server into full lines, Eric Schulte, 2014/03/15
- [elpa] 183/255: explicit connection method for back-end objects, Eric Schulte, 2014/03/15
- [elpa] 179/255: track and display prisoners, Eric Schulte, 2014/03/15