Automatic placement of uploaded image

This commit is contained in:
Andrés Moya 2020-06-01 10:53:50 +02:00 committed by Alonso Torres
parent bac35853d3
commit 56763e9aa8
3 changed files with 73 additions and 9 deletions

View file

@ -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)