mirror of
https://github.com/penpot/penpot.git
synced 2025-06-10 06:11:39 +02:00
✨ Plugins create svg shapes
This commit is contained in:
parent
21d38a058b
commit
67d48435e7
6 changed files with 128 additions and 103 deletions
|
@ -9,6 +9,7 @@
|
|||
(:require
|
||||
[app.common.data.macros :as dm]
|
||||
[app.common.files.changes-builder :as cb]
|
||||
[app.common.geom.point :as gpt]
|
||||
[app.common.record :as cr]
|
||||
[app.common.types.shape :as cts]
|
||||
[app.common.uuid :as uuid]
|
||||
|
@ -127,7 +128,14 @@
|
|||
(createRectangle
|
||||
[_]
|
||||
(create-shape :rect))
|
||||
)
|
||||
|
||||
(createShapeFromSvg
|
||||
[_ svg-string]
|
||||
(let [id (uuid/next)
|
||||
page-id (:current-page-id @st/state)]
|
||||
(st/emit! (dwm/create-svg-shape id "svg" svg-string (gpt/point 0 0)))
|
||||
(shape/data->shape-proxy
|
||||
(dm/get-in @st/state [:workspace-data :pages-index page-id :objects id])))))
|
||||
|
||||
(defn create-context
|
||||
[]
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue