mirror of
https://github.com/penpot/penpot.git
synced 2025-06-02 21:51:37 +02:00
Abstract functions
This commit is contained in:
parent
2eb5efb274
commit
5806ae7426
2 changed files with 7 additions and 3 deletions
|
@ -6,6 +6,7 @@
|
|||
|
||||
(ns app.main.data.tokens
|
||||
(:require
|
||||
[app.common.data :as d]
|
||||
[app.common.data.macros :as dm]
|
||||
[app.common.files.changes-builder :as pcb]
|
||||
[app.common.geom.point :as gpt]
|
||||
|
@ -57,6 +58,9 @@
|
|||
(->> (map (fn [attr] [attr token-id]) attributes)
|
||||
(into {})))
|
||||
|
||||
(defn unapply-token-id [shape attributes]
|
||||
(update shape :applied-tokens d/without-keys attributes))
|
||||
|
||||
(defn apply-token-id-to-attributes [{:keys [shape token-id attributes]}]
|
||||
(let [token (token-from-attributes token-id attributes)]
|
||||
(toggle-or-apply-token shape token)))
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue