mirror of
https://github.com/penpot/penpot.git
synced 2025-08-04 07:38:21 +02:00
✨ Automatic placement of uploaded image
This commit is contained in:
parent
bac35853d3
commit
56763e9aa8
3 changed files with 73 additions and 9 deletions
|
@ -191,6 +191,18 @@
|
|||
(assoc :height value)
|
||||
(assoc :width (* value proportion)))))))
|
||||
|
||||
(defn resize
|
||||
[shape width height]
|
||||
(us/assert map? shape)
|
||||
(us/assert number? width)
|
||||
(us/assert number? height)
|
||||
(-> shape
|
||||
(assoc :width width
|
||||
:height height
|
||||
:x2 (+ (:x1 shape) width)
|
||||
:y2 (+ (:y1 shape) height))
|
||||
(update :selrect (nilf #(resize % width height)))))
|
||||
|
||||
;; --- Setup (Initialize)
|
||||
|
||||
(declare setup-rect)
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue