From ec2eb3d406ca4f83d7f311c0a72e62933ce25efd Mon Sep 17 00:00:00 2001 From: Andrey Antukh Date: Fri, 9 Feb 2024 09:17:14 +0100 Subject: [PATCH] :bug: Fix broken text shapes without position-data on comp-v2 migration --- backend/src/app/features/components_v2.clj | 13 +++++++++++++ 1 file changed, 13 insertions(+) diff --git a/backend/src/app/features/components_v2.clj b/backend/src/app/features/components_v2.clj index 491a49357..f1c2dc469 100644 --- a/backend/src/app/features/components_v2.clj +++ b/backend/src/app/features/components_v2.clj @@ -376,6 +376,19 @@ :selrect selrect :points points)) + (and (cfh/text-shape? shape) + (valid-text-content? (:content shape)) + (not (valid-shape-points? (:points shape))) + (grc/valid-rect? (:selrect shape))) + (let [selrect (:selrect shape) + points (grc/rect->points selrect)] + (assoc shape + :x (:x selrect) + :y (:y selrect) + :width (:width selrect) + :height (:height selrect) + :points points)) + (and (or (cfh/rect-shape? shape) (cfh/svg-raw-shape? shape) (cfh/circle-shape? shape))