mirror of
https://github.com/penpot/penpot.git
synced 2025-05-31 03:46:11 +02:00
🐛 Fix default constraints for migrated graphics
This commit is contained in:
parent
6fd30d50f4
commit
377d9682da
1 changed files with 15 additions and 10 deletions
|
@ -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
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue