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

[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\"?>"



reply via email to

[Prev in Thread] Current Thread [Next in Thread]