mirror of
https://github.com/penpot/penpot.git
synced 2025-05-18 07:56:10 +02:00
🐛 Fix problem when changing typography assets
This commit is contained in:
parent
4f01a63771
commit
f32aaee41f
3 changed files with 31 additions and 16 deletions
|
@ -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')))
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue