mirror of
https://github.com/penpot/penpot.git
synced 2025-07-31 09:38:25 +02: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))))))
|
(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…
Add table
Add a link
Reference in a new issue