mirror of
https://github.com/penpot/penpot.git
synced 2025-02-14 11:09:04 -05:00
Merge pull request #1931 from penpot/alotor-bugfix-initialize-texts
🐛 Fix problem when initializing texts
This commit is contained in:
commit
c83affe351
1 changed files with 11 additions and 3 deletions
|
@ -41,7 +41,10 @@
|
||||||
(not (gsh/empty-modifiers? (:modifiers modifier)))
|
(not (gsh/empty-modifiers? (:modifiers modifier)))
|
||||||
(-> (assoc :grow-type :fixed)
|
(-> (assoc :grow-type :fixed)
|
||||||
(merge modifier) gsh/transform-shape))]
|
(merge modifier) gsh/transform-shape))]
|
||||||
(strip-position-data shape)))
|
(-> shape
|
||||||
|
(cond-> (nil? (:position-data shape))
|
||||||
|
(assoc :migrate true))
|
||||||
|
strip-position-data)))
|
||||||
|
|
||||||
(defn- update-with-editor-state
|
(defn- update-with-editor-state
|
||||||
"Updates the shape with the current state in the editor"
|
"Updates the shape with the current state in the editor"
|
||||||
|
@ -127,9 +130,14 @@
|
||||||
new-shape (get text-shapes id)
|
new-shape (get text-shapes id)
|
||||||
old-modifiers (-> (get prev-modifiers id) strip-modifier)
|
old-modifiers (-> (get prev-modifiers id) strip-modifier)
|
||||||
new-modifiers (-> (get modifiers id) strip-modifier)]
|
new-modifiers (-> (get modifiers id) strip-modifier)]
|
||||||
|
|
||||||
(or (and (not (identical? old-shape new-shape))
|
(or (and (not (identical? old-shape new-shape))
|
||||||
(not= old-shape new-shape))
|
(not= (dissoc old-shape :migrate :position-data)
|
||||||
(not= new-modifiers old-modifiers))))
|
(dissoc new-shape :migrate :position-data)))
|
||||||
|
(not= new-modifiers old-modifiers)
|
||||||
|
|
||||||
|
;; When the position data is nil we force to recalculate
|
||||||
|
(:migrate new-shape))))
|
||||||
|
|
||||||
changed-texts
|
changed-texts
|
||||||
(mf/use-memo
|
(mf/use-memo
|
||||||
|
|
Loading…
Add table
Reference in a new issue