mirror of
https://github.com/penpot/penpot.git
synced 2026-09-14 16:09:01 +00:00
🐛 Fix incompatibilities of old file migrations with new code
This commit is contained in:
parent
04be6b13be
commit
295d9568c8
@ -109,11 +109,14 @@
|
|||||||
(assoc :points (grc/rect->points selrect))))))
|
(assoc :points (grc/rect->points selrect))))))
|
||||||
|
|
||||||
(fix-empty-points [shape]
|
(fix-empty-points [shape]
|
||||||
(let [shape (cond-> shape
|
(if (empty? (:points shape))
|
||||||
(empty? (:selrect shape)) (cts/setup-rect))]
|
(-> shape
|
||||||
(cond-> shape
|
(update :selrect (fn [selrect]
|
||||||
(empty? (:points shape))
|
(if (map? selrect)
|
||||||
(assoc :points (grc/rect->points (:selrect shape))))))
|
(grc/make-rect selrect)
|
||||||
|
selrect)))
|
||||||
|
(cts/setup-shape))
|
||||||
|
shape))
|
||||||
|
|
||||||
(update-object [object]
|
(update-object [object]
|
||||||
(cond-> object
|
(cond-> object
|
||||||
@ -857,4 +860,4 @@
|
|||||||
(update-container [container]
|
(update-container [container]
|
||||||
(d/update-when container :objects update-vals fix-shape))]
|
(d/update-when container :objects update-vals fix-shape))]
|
||||||
(-> data
|
(-> data
|
||||||
(update :pages-index update-vals update-container))))
|
(update :pages-index update-vals update-container))))
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user