branch: externals/sketch-mode
commit 4fd793222ecc67595abb28cb1dbc3b686c1d0f73
Author: Daniel Nicolai <[email protected]>
Commit: Daniel Nicolai <[email protected]>
Fix (uncomment) labels
---
sketch-mode.el | 64 +++++++++++++++++++++++++++++-----------------------------
1 file changed, 32 insertions(+), 32 deletions(-)
diff --git a/sketch-mode.el b/sketch-mode.el
index 4068760..7cf4907 100644
--- a/sketch-mode.el
+++ b/sketch-mode.el
@@ -305,38 +305,38 @@ If value of variable ‘sketch-show-labels' is ‘layer',
create ..."
(+ (dom-attr node 'x) 2)
(+ (dom-attr node 'y)
(- (dom-attr node 'height) 2))))
- ;; ('line (sketch-label-text-node
- ;; node
- ;; (dom-attr node 'x1)
- ;; (dom-attr node 'y1)))
- ;; ((or 'circle 'ellipse)
- ;; (sketch-label-text-node
- ;; node
- ;; (dom-attr node 'cx)
- ;; (dom-attr node 'cy)))
- ;; ((or 'polyline 'polygon)
- ;; (let ((coords (split-string
- ;; (car (split-string (dom-attr node 'points)
","))
- ;; nil
- ;; t)))
- ;; (sketch-label-text-node
- ;; node
- ;; (string-to-number (car coords))
- ;; (string-to-number (cadr coords)))))
- ;; ('text (sketch-label-text-node
- ;; node
- ;; (dom-attr node 'x)
- ;; (+ (dom-attr node 'y)
- ;; sketch-label-size)))
- ;; ('g (let ((s (dom-attr node
- ;; 'transform)))
- ;; (string-match "translate\(\\([0-9]*\\)[,
]*\\([0-9]*\\)" s)
- ;; (let ((x (match-string 1 s))
- ;; (y (match-string 2 s)))
- ;; (sketch-label-text-node
- ;; node
- ;; x
- ;; y))))
+ ('line (sketch-label-text-node
+ node
+ (dom-attr node 'x1)
+ (dom-attr node 'y1)))
+ ((or 'circle 'ellipse)
+ (sketch-label-text-node
+ node
+ (dom-attr node 'cx)
+ (dom-attr node 'cy)))
+ ((or 'polyline 'polygon)
+ (let ((coords (split-string
+ (car (split-string (dom-attr node 'points) ","))
+ nil
+ t)))
+ (sketch-label-text-node
+ node
+ (string-to-number (car coords))
+ (string-to-number (cadr coords)))))
+ ('text (sketch-label-text-node
+ node
+ (dom-attr node 'x)
+ (+ (dom-attr node 'y)
+ sketch-label-size)))
+ ('g (let ((s (dom-attr node
+ 'transform)))
+ (string-match "translate\(\\([0-9]*\\)[, ]*\\([0-9]*\\)" s)
+ (let ((x (match-string 1 s))
+ (y (match-string 2 s)))
+ (sketch-label-text-node
+ node
+ x
+ y))))
))
nodes))
svg-labels))