From 377d9682da629b8b73929081b17579c910810edd Mon Sep 17 00:00:00 2001 From: Alejandro Alonso Date: Tue, 13 Feb 2024 16:49:45 +0100 Subject: [PATCH] :bug: Fix default constraints for migrated graphics --- backend/src/app/features/components_v2.clj | 25 +++++++++++++--------- 1 file changed, 15 insertions(+), 10 deletions(-) diff --git a/backend/src/app/features/components_v2.clj b/backend/src/app/features/components_v2.clj index 72f416bdf..67cf48b07 100644 --- a/backend/src/app/features/components_v2.clj +++ b/backend/src/app/features/components_v2.clj @@ -1187,15 +1187,18 @@ "Convert a media object that contains a bitmap image into shapes, one shape of type :image and one group that contains it." [{:keys [name width height id mtype]} frame-id position] - (let [frame-shape (cts/setup-shape - {:type :frame - :x (:x position) - :y (:y position) - :width width - :height height - :name name - :frame-id frame-id - :parent-id frame-id}) + (let [frame-shape (-> (cts/setup-shape + {:type :frame + :x (:x position) + :y (:y position) + :width width + :height height + :name name + :frame-id frame-id + :parent-id frame-id}) + (assoc + :proportion (/ width height) + :proportion-lock true)) img-shape (cts/setup-shape {:type :image @@ -1209,7 +1212,9 @@ :mtype mtype} :name name :frame-id (:id frame-shape) - :parent-id (:id frame-shape)})] + :parent-id (:id frame-shape) + :constraints-h :scale + :constraints-v :scale})] [frame-shape [img-shape]])) (defn- parse-datauri