mirror of
https://github.com/penpot/penpot.git
synced 2025-03-11 07:11:32 -05:00
🐛 Fix incompatibilities of old file migrations with new code
This commit is contained in:
parent
04be6b13be
commit
295d9568c8
1 changed files with 9 additions and 6 deletions
|
@ -109,11 +109,14 @@
|
|||
(assoc :points (grc/rect->points selrect))))))
|
||||
|
||||
(fix-empty-points [shape]
|
||||
(let [shape (cond-> shape
|
||||
(empty? (:selrect shape)) (cts/setup-rect))]
|
||||
(cond-> shape
|
||||
(empty? (:points shape))
|
||||
(assoc :points (grc/rect->points (:selrect shape))))))
|
||||
(if (empty? (:points shape))
|
||||
(-> shape
|
||||
(update :selrect (fn [selrect]
|
||||
(if (map? selrect)
|
||||
(grc/make-rect selrect)
|
||||
selrect)))
|
||||
(cts/setup-shape))
|
||||
shape))
|
||||
|
||||
(update-object [object]
|
||||
(cond-> object
|
||||
|
@ -857,4 +860,4 @@
|
|||
(update-container [container]
|
||||
(d/update-when container :objects update-vals fix-shape))]
|
||||
(-> data
|
||||
(update :pages-index update-vals update-container))))
|
||||
(update :pages-index update-vals update-container))))
|
||||
|
|
Loading…
Add table
Reference in a new issue