[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[elpa] 197/255: use new mark machinery to apply labels
From: |
Eric Schulte |
Subject: |
[elpa] 197/255: use new mark machinery to apply labels |
Date: |
Sun, 16 Mar 2014 01:02:47 +0000 |
eschulte pushed a commit to branch go
in repository elpa.
commit 0879062edbd7767b30809177c1f29df29922e908
Author: Eric Schulte <address@hidden>
Date: Mon May 20 18:41:40 2013 -0600
use new mark machinery to apply labels
---
go-board-faces.el | 38 +++++++++-----------------------------
1 files changed, 9 insertions(+), 29 deletions(-)
diff --git a/go-board-faces.el b/go-board-faces.el
index 4928b7d..ff0bf06 100644
--- a/go-board-faces.el
+++ b/go-board-faces.el
@@ -98,12 +98,19 @@
(style . ,(format "stroke: %s;" color)))))
""))
-(defun go-board-mark (overlay color)
+(defun go-board-label (color label)
+ (go-board-svg-trans
+ `((text (x . 8.75) (y . 16.25) (r . 12.25)
+ (style . ,(format "font-size:12.5;fill:%s;" color)))
+ ,label)))
+
+(defun go-board-mark (overlay mark)
+ "Write MARK over top of the SVG image in OVERLAY."
(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)
+ mark
(substring data (match-beginning 0))))
(overlay-put overlay 'display (cons 'image disp)))))
@@ -171,31 +178,4 @@
((path (stroke . "#000") (stroke-width . 1) (d . "M0,12.5H25M12.5,0V25")))
((circle (cx . 12.5) (cy . 12.5) (r . 2.5)))))
-(defmacro go-board-image-label (label)
- `(go-board-image
- ((text (x . 8.75) (y . 16.25) (r . 12.25) (style . "font-size:12.5;"))
- ,label)))
-
-(defmacro go-board-image-white-label (label)
- `(go-board-image
- ((defs)
- ((radialGradient (id . "$rg") (cx . ".47") (cy . ".49") (r . ".48"))
- ((stop (offset . 0.7) (stop-color . "#FFF")))
- ((stop (offset . 0.9) (stop-color . "#DDD")))
- ((stop (offset . 1) (stop-color . "#777")))))
- ((circle (cx . 12.5) (cy . 12.5) (r . 9.375) (fill . "url(#$rg)")))
- ((text (x . 8.75) (y . 16.25) (r . 12.25) (style . "font-size:12.5;"))
- ,label)))
-
-(defmacro go-board-image-black-label (label)
- `(go-board-image
- ((defs)
- ((radialGradient (id . "$rg") (cx . ".3") (cy . ".3") (r . ".8"))
- ((stop (offset . 0) (stop-color . "#777")))
- ((stop (offset . 0.3) (stop-color . "#222")))
- ((stop (offset . 1) (stop-color . "#000")))))
- ((circle (cx . 12.5) (cy . 12.5) (r . 9.375) (fill . "url(#$rg)")))
- ((text (x . 8.75) (y . 16.25) (r . 12.25)
- (style . "font-size:12.5;fill:#ffffff;")) ,label)))
-
(provide 'go-board-faces)
- [elpa] 176/255: task managment, (continued)
- [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, 2014/03/15
- [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 <=
- [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
- [elpa] 202/255: added interface function to view an SGF file, Eric Schulte, 2014/03/15
- [elpa] 205/255: update the README, Eric Schulte, 2014/03/15
- [elpa] 206/255: ensure prisoners are 0 at the start of a new game, Eric Schulte, 2014/03/15
- [elpa] 208/255: support for viewing lists in a buffer, Eric Schulte, 2014/03/15