0
Fork 0
mirror of https://github.com/penpot/penpot.git synced 2025-02-12 18:18:24 -05:00

🐛 Fix idempotency problem on fdata migration 25

This commit is contained in:
Andrey Antukh 2024-02-22 13:01:43 +01:00
parent dec622600d
commit 0999ecb2a9
2 changed files with 8 additions and 5 deletions

View file

@ -492,9 +492,11 @@
[data]
(some-> cfeat/*new* (swap! conj "fdata/shape-data-type"))
(letfn [(update-object [object]
(-> object
(d/update-when :selrect grc/make-rect)
(cts/map->Shape)))
(if (cfh/root? object)
object
(-> object
(update :selrect grc/make-rect)
(cts/map->Shape))))
(update-container [container]
(d/update-when container :objects update-vals update-object))]
(-> data

View file

@ -63,10 +63,11 @@
(make-rect x1 y1 (- x2 x1) (- y2 y1))))
([x y width height]
(when (d/num? x y width height)
(if (d/num? x y width height)
(let [w (mth/max width 0.01)
h (mth/max height 0.01)]
(pos->Rect x y w h x y (+ x w) (+ y h))))))
(pos->Rect x y w h x y (+ x w) (+ y h)))
(make-rect))))
(def ^:private schema:rect-attrs
[:map {:title "RectAttrs"}