🐛 Fix problem when changing typography assets

This commit is contained in:
alonso.torres 2024-03-08 11:52:57 +01:00
parent 4f01a63771
commit f32aaee41f
3 changed files with 31 additions and 16 deletions

View file

@ -464,21 +464,35 @@
[changes shape container update-node]
(let [old-content (:content shape)
new-content (txt/transform-nodes update-node old-content)
redo-change
(make-change
container
{:type :mod-obj
:id (:id shape)
:operations [{:type :set
:attr :content
:val new-content}
{:type :set
:attr :position-data
:val nil}]})
undo-change
(make-change
container
{:type :mod-obj
:id (:id shape)
:operations [{:type :set
:attr :content
:val old-content}
{:type :set
:attr :position-data
:val nil}]})
changes' (-> changes
(update :redo-changes conj (make-change
container
{:type :mod-obj
:id (:id shape)
:operations [{:type :set
:attr :content
:val new-content}]}))
(update :undo-changes conj (make-change
container
{:type :mod-obj
:id (:id shape)
:operations [{:type :set
:attr :content
:val old-content}]})))]
(update :redo-changes conj redo-change)
(update :undo-changes conj undo-change))]
(if (= new-content old-content)
changes
changes')))