mirror of
https://github.com/penpot/penpot.git
synced 2025-01-24 07:29:08 -05:00
Setup new shape proportions on the end of resize.
This commit is contained in:
parent
5d0661c05f
commit
a11b618d24
1 changed files with 4 additions and 3 deletions
|
@ -44,11 +44,12 @@
|
|||
;; --- Resize Implementation
|
||||
|
||||
(defn- start-resize
|
||||
[vid shape]
|
||||
[vid sid]
|
||||
(letfn [(on-resize [[delta ctrl?]]
|
||||
(let [params {:vid vid :delta (assoc delta :lock ctrl?)}]
|
||||
(rs/emit! (uds/update-vertex-position shape params))))
|
||||
(rs/emit! (uds/update-vertex-position sid params))))
|
||||
(on-end []
|
||||
(rs/emit! (uds/setup-proportions sid))
|
||||
(rlocks/release! :shape/resize))]
|
||||
(let [stoper (->> wb/events-s
|
||||
(rx/map first)
|
||||
|
@ -59,7 +60,7 @@
|
|||
(rx/with-latest-from vector wb/mouse-ctrl-s))]
|
||||
(rlocks/acquire! :shape/resize)
|
||||
(when @wb/alignment-ref
|
||||
(rs/emit! (uds/initial-vertext-align shape vid)))
|
||||
(rs/emit! (uds/initial-vertext-align sid vid)))
|
||||
(rx/subscribe stream on-resize nil on-end))))
|
||||
|
||||
;; --- Selection Handlers (Component)
|
||||
|
|
Loading…
Add table
Reference in a new issue