[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[elpa] externals/sketch-mode bcb99c9 35/38: Implement text label and mod
From: |
ELPA Syncer |
Subject: |
[elpa] externals/sketch-mode bcb99c9 35/38: Implement text label and modify feature |
Date: |
Wed, 15 Sep 2021 16:57:40 -0400 (EDT) |
branch: externals/sketch-mode
commit bcb99c98f9c54701c0a0510651ad6a3ccacd9454
Author: Daniel Nicolai <dalanicolai@gmail.com>
Commit: Daniel Nicolai <dalanicolai@gmail.com>
Implement text label and modify feature
---
sketch-mode.el | 24 +++++++++++++++++++-----
1 file changed, 19 insertions(+), 5 deletions(-)
diff --git a/sketch-mode.el b/sketch-mode.el
index 0089246..819fd9e 100644
--- a/sketch-mode.el
+++ b/sketch-mode.el
@@ -584,6 +584,14 @@ else return nil"
:font-size sketch-label-size
:stroke "red"
:fill "red"))
+ ('text (svg-text svg-labels
+ (dom-attr node 'id)
+ :x (dom-attr node 'x)
+ :y (+ (dom-attr node 'y)
+ sketch-label-size)
+ :font-size sketch-label-size
+ :stroke "red"
+ :fill "red"))
('g (let ((s (dom-attr node
'transform)))
(string-match "translate\(\\([0-9]*\\)[, ]*\\([0-9]*\\)" s)
@@ -624,6 +632,7 @@ else return nil"
("rectangle" "r")
("circle" "c")
("ellipse" "e")
+ ("text" "t")
("group" "g"))))
(idx 0)
(label (concat prefix (number-to-string idx)))
@@ -1103,7 +1112,6 @@ PROPS is passed on to `create-image' as its PROPS list."
(object-def (dom-by-id sketch-svg (format "^%s$" object))))
(sketch-group-scale buffer (car object-def) 'down t)))
-
;; TODO 'refactor' subsequent suffixes (e.g. create general function/macro)
(transient-define-suffix sketch-translate-down (args)
(interactive (list (oref transient-current-prefix value)))
@@ -1116,7 +1124,10 @@ PROPS is passed on to `create-image' as its PROPS list."
(sketch-translate-object buffer
object-def
props
- '(y1 y2) 1))))
+ (pcase (caar object-def)
+ ('line '(y1 y2))
+ ('text '(y)))
+ 1))))
(transient-define-suffix sketch-translate-fast-down (args)
(interactive (list (oref transient-current-prefix value)))
@@ -1130,7 +1141,8 @@ PROPS is passed on to `create-image' as its PROPS list."
object-def
props
(pcase (caar object-def)
- ('line '(y1 y2)))
+ ('line '(y1 y2))
+ ('text '(y)))
10))))
(transient-define-suffix sketch-translate-up (args)
@@ -1145,7 +1157,8 @@ PROPS is passed on to `create-image' as its PROPS list."
object-def
props
(pcase (caar object-def)
- ('line '(y1 y2)))
+ ('line '(y1 y2))
+ ('text '(y)))
-1))))
(transient-define-suffix sketch-translate-fast-up (args)
@@ -1160,7 +1173,8 @@ PROPS is passed on to `create-image' as its PROPS list."
object-def
props
(pcase (caar object-def)
- ('line '(y1 y2)))
+ ('line '(y1 y2))
+ ('text '(y)))
-10))))
(transient-define-prefix sketch-modify-object (&optional group)
- [elpa] externals/sketch-mode 32559c4 06/38: Add remove functionality (id's and labels), (continued)
- [elpa] externals/sketch-mode 32559c4 06/38: Add remove functionality (id's and labels), ELPA Syncer, 2021/09/15
- [elpa] externals/sketch-mode 5c37145 09/38: Add sponsor button, ELPA Syncer, 2021/09/15
- [elpa] externals/sketch-mode b944693 10/38: Add crop image feature AND add text transient into main, ELPA Syncer, 2021/09/15
- [elpa] externals/sketch-mode f82ed74 11/38: Update documentation (add screencast), ELPA Syncer, 2021/09/15
- [elpa] externals/sketch-mode 4d78311 18/38: Experimental object modify tabulated list, ELPA Syncer, 2021/09/15
- [elpa] externals/sketch-mode d42f84a 22/38: Add svg and sketch group definitions, ELPA Syncer, 2021/09/15
- [elpa] externals/sketch-mode e3c16c7 26/38: Merge branch 'implement-layers' (incl. undo-tree undo/redo), ELPA Syncer, 2021/09/15
- [elpa] externals/sketch-mode 951c284 28/38: Fix dot marker and rename (make internal) sketch-snap-to-grid, ELPA Syncer, 2021/09/15
- [elpa] externals/sketch-mode f0465ec 29/38: Remove sketch-interactive function, ELPA Syncer, 2021/09/15
- [elpa] externals/sketch-mode 4c6a675 36/38: Fix load definition functionality (also set layers list), ELPA Syncer, 2021/09/15
- [elpa] externals/sketch-mode bcb99c9 35/38: Implement text label and modify feature,
ELPA Syncer <=
- [elpa] externals/sketch-mode 49c3c04 34/38: Add dasharray feature, ELPA Syncer, 2021/09/15
- [elpa] externals/sketch-mode 4a4e2ba 33/38: Implement import/snippet functionality, ELPA Syncer, 2021/09/15
- [elpa] externals/sketch-mode 37af8f4 01/38: Initial commit, ELPA Syncer, 2021/09/15
- [elpa] externals/sketch-mode 0f870a1 20/38: Implement load from definition buffer & modify object functionality, ELPA Syncer, 2021/09/15
- [elpa] externals/sketch-mode fadc554 21/38: Add xml processing instruction and DOCTYPE element (see #4), ELPA Syncer, 2021/09/15
- [elpa] externals/sketch-mode 414ec7c 15/38: Don't print coordinates to message buffer, ELPA Syncer, 2021/09/15
- [elpa] externals/sketch-mode 87a0808 16/38: Fix file header, ELPA Syncer, 2021/09/15
- [elpa] externals/sketch-mode 7583fcb 17/38: Fix variable names and implement svg lisp togglable side window, ELPA Syncer, 2021/09/15
- [elpa] externals/sketch-mode 8b63796 19/38: First try: implement update for both type side-winows, ELPA Syncer, 2021/09/15
- [elpa] externals/sketch-mode ec35bb4 23/38: Add xml processing instruction and DOCTYPE element (see #4), ELPA Syncer, 2021/09/15