🐛 Fix default constraints for migrated graphics

This commit is contained in:
Alejandro Alonso 2024-02-13 16:49:45 +01:00 committed by Alonso Torres
parent 6fd30d50f4
commit 377d9682da

View file

@ -1187,15 +1187,18 @@
"Convert a media object that contains a bitmap image into shapes, "Convert a media object that contains a bitmap image into shapes,
one shape of type :image and one group that contains it." one shape of type :image and one group that contains it."
[{:keys [name width height id mtype]} frame-id position] [{:keys [name width height id mtype]} frame-id position]
(let [frame-shape (cts/setup-shape (let [frame-shape (-> (cts/setup-shape
{:type :frame {:type :frame
:x (:x position) :x (:x position)
:y (:y position) :y (:y position)
:width width :width width
:height height :height height
:name name :name name
:frame-id frame-id :frame-id frame-id
:parent-id frame-id}) :parent-id frame-id})
(assoc
:proportion (/ width height)
:proportion-lock true))
img-shape (cts/setup-shape img-shape (cts/setup-shape
{:type :image {:type :image
@ -1209,7 +1212,9 @@
:mtype mtype} :mtype mtype}
:name name :name name
:frame-id (:id frame-shape) :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]])) [frame-shape [img-shape]]))
(defn- parse-datauri (defn- parse-datauri