mirror of
https://github.com/penpot/penpot.git
synced 2025-05-21 00:06:12 +02:00
Merge pull request #3042 from penpot/azazeln28-fix-scaling-frame-proportionally
Fix scaling frame proportionally
This commit is contained in:
commit
1b3281457e
6 changed files with 88 additions and 29 deletions
|
@ -438,14 +438,20 @@
|
|||
:flip-x
|
||||
:flip-y
|
||||
:grow-type
|
||||
:layout-item-h-sizing
|
||||
:layout-item-v-sizing
|
||||
:position-data
|
||||
:layout-gap
|
||||
:layout-padding
|
||||
:layout-item-h-sizing
|
||||
:layout-item-margin
|
||||
:layout-item-max-h
|
||||
:layout-item-max-w
|
||||
:layout-item-min-h
|
||||
:layout-item-min-w
|
||||
:layout-item-v-sizing
|
||||
:layout-padding-type
|
||||
:layout-gap
|
||||
:layout-item-margin
|
||||
:layout-item-margin-type
|
||||
:position-data
|
||||
]})
|
||||
;; We've applied the text-modifier so we can dissoc the temporary data
|
||||
(fn [state]
|
||||
|
|
|
@ -104,7 +104,8 @@
|
|||
(defn start-resize
|
||||
"Enter mouse resize mode, until mouse button is released."
|
||||
[handler ids shape]
|
||||
(letfn [(resize [shape initial layout [point lock? center? point-snap]]
|
||||
(letfn [(resize
|
||||
[shape initial layout [point lock? center? point-snap]]
|
||||
(let [{:keys [width height]} (:selrect shape)
|
||||
{:keys [rotation]} shape
|
||||
|
||||
|
@ -192,7 +193,7 @@
|
|||
(ctm/scale-content (:x scalev))))
|
||||
|
||||
modif-tree (dwm/create-modif-tree ids modifiers)]
|
||||
(rx/of (dwm/set-modifiers modif-tree))))
|
||||
(rx/of (dwm/set-modifiers modif-tree scale-text))))
|
||||
|
||||
;; Unifies the instantaneous proportion lock modifier
|
||||
;; activated by Shift key and the shapes own proportion
|
||||
|
@ -209,7 +210,7 @@
|
|||
ptk/WatchEvent
|
||||
(watch [_ state stream]
|
||||
(let [initial-position @ms/mouse-position
|
||||
stoper (rx/filter ms/mouse-up? stream)
|
||||
stopper (rx/filter ms/mouse-up? stream)
|
||||
layout (:workspace-layout state)
|
||||
page-id (:current-page-id state)
|
||||
focus (:workspace-focus-selected state)
|
||||
|
@ -226,7 +227,7 @@
|
|||
(->> (snap/closest-snap-point page-id resizing-shapes objects layout zoom focus point)
|
||||
(rx/map #(conj current %)))))
|
||||
(rx/mapcat (partial resize shape initial-position layout))
|
||||
(rx/take-until stoper))
|
||||
(rx/take-until stopper))
|
||||
(rx/of (dwm/apply-modifiers)
|
||||
(finish-transform))))))))
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue