From 26fa2a71ea812735d39a942724b7f2f87d5a6d82 Mon Sep 17 00:00:00 2001 From: "alonso.torres" Date: Mon, 22 Jul 2024 11:27:12 +0200 Subject: [PATCH] :bug: Fix problem with reset alignment on change text --- common/src/app/common/text.cljc | 12 ++++++++---- 1 file changed, 8 insertions(+), 4 deletions(-) diff --git a/common/src/app/common/text.cljc b/common/src/app/common/text.cljc index c82f65c9b8..c5d14f5498 100644 --- a/common/src/app/common/text.cljc +++ b/common/src/app/common/text.cljc @@ -428,6 +428,8 @@ [shape text] (let [content (:content shape) + root-styles (select-keys content root-attrs) + paragraph-style (merge default-text-attrs (select-keys (->> content (node-seq is-paragraph-node?) first) text-all-attrs)) @@ -447,10 +449,12 @@ :children [(merge {:text pt} text-style)]})))) new-content - {:type "root" - :children - [{:type "paragraph-set" - :children paragraphs}]}] + (d/patch-object + {:type "root" + :children + [{:type "paragraph-set" + :children paragraphs}]} + root-styles)] (assoc shape :content new-content)))