From 525da266b82539fcb51cfd6cddf219f345b4f8db Mon Sep 17 00:00:00 2001 From: "alonso.torres" Date: Tue, 24 May 2022 23:33:21 +0200 Subject: [PATCH] :bug: Creates a migration to invalidate texts-position-data --- common/src/app/common/pages/common.cljc | 2 +- common/src/app/common/pages/migrations.cljc | 15 +++++++++++++++ 2 files changed, 16 insertions(+), 1 deletion(-) diff --git a/common/src/app/common/pages/common.cljc b/common/src/app/common/pages/common.cljc index 30351a666..825558259 100644 --- a/common/src/app/common/pages/common.cljc +++ b/common/src/app/common/pages/common.cljc @@ -9,7 +9,7 @@ [app.common.colors :as clr] [app.common.uuid :as uuid])) -(def file-version 17) +(def file-version 18) (def default-color clr/gray-20) (def root uuid/zero) diff --git a/common/src/app/common/pages/migrations.cljc b/common/src/app/common/pages/migrations.cljc index 95e0a1840..eb0f1c77f 100644 --- a/common/src/app/common/pages/migrations.cljc +++ b/common/src/app/common/pages/migrations.cljc @@ -400,5 +400,20 @@ (update :pages-index d/update-vals update-container) (update :components d/update-vals update-container)))) +;;Remove position-data to solve a bug with the text positioning +(defmethod migrate 18 + [data] + (letfn [(update-object [object] + (cond-> object + (cph/text-shape? object) + (dissoc :position-data))) + + (update-container [container] + (update container :objects d/update-vals update-object))] + + (-> data + (update :pages-index d/update-vals update-container) + (update :components d/update-vals update-container)))) + ;; TODO: pending to do a migration for delete already not used fill ;; and stroke props. This should be done for >1.14.x version.