From 4ca4b439731fd4f4942482280d1c8955d364fbd1 Mon Sep 17 00:00:00 2001 From: Andrey Antukh Date: Fri, 17 Apr 2026 11:33:34 +0200 Subject: [PATCH] WIP --- common/src/app/common/attrs.cljc | 21 ++++++++++++------- .../sidebar/options/shapes/multiple.cljs | 8 +++---- 2 files changed, 18 insertions(+), 11 deletions(-) diff --git a/common/src/app/common/attrs.cljc b/common/src/app/common/attrs.cljc index e990cb17c7..93211bad42 100644 --- a/common/src/app/common/attrs.cljc +++ b/common/src/app/common/attrs.cljc @@ -89,6 +89,7 @@ (get-attrs-multi objs attrs default-equal identity)) ([objs attrs eqfn sel] + (loop [attr (first attrs) attrs (rest attrs) result (transient {})] @@ -100,13 +101,19 @@ (if (and curr (not= value :multiple)) (let [new-val (get-attr curr attr) - value (cond - (= new-val ::unset) value - (= new-val :multiple) :multiple - (= value ::unset) (sel new-val) - (eqfn new-val value) value - :else :multiple)] - (recur (first objs) (rest objs) value)) + value (cond + (= new-val ::unset) + (if (not= value ::unset) + :multiple + value) + (= new-val :multiple) :multiple + (= value ::unset) (sel new-val) + (eqfn new-val value) value + :else :multiple)] + + (if (= value :multiple) + value + (recur (first objs) (rest objs) value))) value))] diff --git a/frontend/src/app/main/ui/workspace/sidebar/options/shapes/multiple.cljs b/frontend/src/app/main/ui/workspace/sidebar/options/shapes/multiple.cljs index f3c6ee2b1e..85235ca0eb 100644 --- a/frontend/src/app/main/ui/workspace/sidebar/options/shapes/multiple.cljs +++ b/frontend/src/app/main/ui/workspace/sidebar/options/shapes/multiple.cljs @@ -267,11 +267,11 @@ (attrs/get-text-attrs-multi shape txt/default-text-attrs attrs) new-values - (-> values - (merge-attrs shape-attrs) - (merge-attrs content-attrs)) + (merge-attrs values (merge shape-attrs content-attrs)) + + new-token-acc + (merge-token-values token-acc content-attrs applied-tokens)] - new-token-acc (merge-token-values token-acc content-attrs applied-tokens)] [(conj ids id) new-values new-token-acc])