0
Fork 0
mirror of https://github.com/penpot/penpot.git synced 2025-01-10 17:00:36 -05:00

🐛 Fix dirty text modifiers when changing pages

This commit is contained in:
alonso.torres 2022-05-19 14:15:33 +02:00 committed by Andrés Moya
parent 25ff15c62e
commit d45bb0ace1
2 changed files with 12 additions and 1 deletions

View file

@ -375,6 +375,15 @@
(update [_ state] (update [_ state]
(update-in state [:workspace-text-modifier id] (fnil merge {}) props)))) (update-in state [:workspace-text-modifier id] (fnil merge {}) props))))
(defn clean-text-modifier
[id]
(ptk/reify ::clean-text-modifier
ptk/WatchEvent
(watch [_ _ _]
(->> (rx/of #(update % :workspace-text-modifier dissoc id))
;; We delay a bit the change so there is no weird transition to the user
(rx/delay 50)))))
(defn remove-text-modifier (defn remove-text-modifier
[id] [id]
(ptk/reify ::remove-text-modifier (ptk/reify ::remove-text-modifier

View file

@ -68,7 +68,9 @@
;; Update the position-data of every text fragment ;; Update the position-data of every text fragment
(let [position-data (utp/calc-position-data node)] (let [position-data (utp/calc-position-data node)]
(st/emit! (dwt/update-position-data id position-data)))) (st/emit! (dwt/update-position-data id position-data)))
(st/emit! (dwt/clean-text-modifier id)))
(defn- update-text-modifier (defn- update-text-modifier
[{:keys [grow-type id]} node] [{:keys [grow-type id]} node]