diff --git a/common/src/app/common/files/migrations.cljc b/common/src/app/common/files/migrations.cljc index 2823bf3e21..8ba0857802 100644 --- a/common/src/app/common/files/migrations.cljc +++ b/common/src/app/common/files/migrations.cljc @@ -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 diff --git a/common/src/app/common/geom/rect.cljc b/common/src/app/common/geom/rect.cljc index ce01fb0cb1..48d620adfc 100644 --- a/common/src/app/common/geom/rect.cljc +++ b/common/src/app/common/geom/rect.cljc @@ -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"}