[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[elpa] 196/255: mark an overlay with a black or white cross
From: |
Eric Schulte |
Subject: |
[elpa] 196/255: mark an overlay with a black or white cross |
Date: |
Sun, 16 Mar 2014 01:02:47 +0000 |
eschulte pushed a commit to branch go
in repository elpa.
commit 8b2456a5000fae0be55127441314e384b3f06a66
Author: Eric Schulte <address@hidden>
Date: Mon May 20 18:28:35 2013 -0600
mark an overlay with a black or white cross
---
go-board-faces.el | 17 +++++++++++++++++
1 files changed, 17 insertions(+), 0 deletions(-)
diff --git a/go-board-faces.el b/go-board-faces.el
index e507f5f..4928b7d 100644
--- a/go-board-faces.el
+++ b/go-board-faces.el
@@ -90,6 +90,23 @@
"/>"))
list))
+(defun go-board-cross (color)
+ (mapconcat #'go-board-svg-trans
+ `(((line (x1 . 3.125) (y1 . 3.125) (x2 . 21.875) (y2 . 21.875)
+ (style . ,(format "stroke: %s;" color))))
+ ((line (x1 . 3.125) (y1 . 21.875) (x2 . 21.875) (y2 . 3.125)
+ (style . ,(format "stroke: %s;" color)))))
+ ""))
+
+(defun go-board-mark (overlay color)
+ (let* ((disp (cdr (overlay-get overlay 'display)))
+ (data (plist-get disp :data)))
+ (when (and data (string-match (regexp-quote "</svg>") data))
+ (plist-put disp :data (concat (substring data 0 (match-beginning 0))
+ (go-board-cross color)
+ (substring data (match-beginning 0))))
+ (overlay-put overlay 'display (cons 'image disp)))))
+
(defmacro go-board-wrap (&rest body)
`(concat
"<?xml version=\"1.0\" encoding=\"UTF-8\"?>"
- [elpa] 184/255: safer and automatic quitting, (continued)
- [elpa] 184/255: safer and automatic quitting, Eric Schulte, 2014/03/15
- [elpa] 186/255: better interactive debugging, Eric Schulte, 2014/03/15
- [elpa] 191/255: don't throw error when backend passes, Eric Schulte, 2014/03/15
- [elpa] 185/255: remove dependencies on org-mode functions, Eric Schulte, 2014/03/15
- [elpa] 176/255: task managment, Eric Schulte, 2014/03/15
- [elpa] 178/255: process igs "tell" messages, Eric Schulte, 2014/03/15
- [elpa] 181/255: NOTES #+option, Eric Schulte, 2014/03/15
- [elpa] 193/255: calculate the final score, Eric Schulte, 2014/03/15
- [elpa] 194/255: notes on scaling image sizes, Eric Schulte, 2014/03/15
- [elpa] 198/255: don't mutate hidden state, Eric Schulte, 2014/03/15
- [elpa] 196/255: mark an overlay with a black or white cross,
Eric Schulte <=
- [elpa] 187/255: don't commit if process already quit, Eric Schulte, 2014/03/15
- [elpa] 188/255: adding README, Eric Schulte, 2014/03/15
- [elpa] 199/255: marking captured territory when game ends, Eric Schulte, 2014/03/15
- [elpa] 197/255: use new mark machinery to apply labels, Eric Schulte, 2014/03/15
- [elpa] 195/255: query backend for territory, Eric Schulte, 2014/03/15
- [elpa] 201/255: print score after marking territory, Eric Schulte, 2014/03/15
- [elpa] 189/255: replace flet with cl-flet, Eric Schulte, 2014/03/15
- [elpa] 190/255: set level (mainly for playing GNUGO), Eric Schulte, 2014/03/15
- [elpa] 204/255: prefix external names with package name, Eric Schulte, 2014/03/15
- [elpa] 165/255: working on placing backgrounds behind pieces, Eric Schulte, 2014/03/15