Abstract functions

This commit is contained in:
Florian Schroedl 2024-05-22 16:20:40 +02:00
parent 2eb5efb274
commit 5806ae7426
2 changed files with 7 additions and 3 deletions

View file

@ -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)))