mirror of
https://github.com/penpot/penpot.git
synced 2026-05-11 11:03:52 +00:00
🐛 Fix proportional scaling with grid layout
This commit is contained in:
parent
994d08b479
commit
2b715851e1
@ -756,6 +756,9 @@
|
||||
(ctl/flex-layout? shape)
|
||||
(ctl/update-flex-scale value)
|
||||
|
||||
(ctl/grid-layout? shape)
|
||||
(ctl/update-grid-scale value)
|
||||
|
||||
:always
|
||||
(ctl/update-flex-child value)))]
|
||||
|
||||
|
||||
@ -601,6 +601,16 @@
|
||||
(d/update-in-when [:layout-padding :p3] * scale)
|
||||
(d/update-in-when [:layout-padding :p4] * scale)))
|
||||
|
||||
(defn update-grid-scale
|
||||
[shape scale]
|
||||
(letfn [(scale-track [track]
|
||||
(cond-> track
|
||||
(= (:type track) :fixed)
|
||||
(update :value * scale)))]
|
||||
(-> shape
|
||||
(update :layout-grid-columns #(mapv scale-track %))
|
||||
(update :layout-grid-rows #(mapv scale-track %)))))
|
||||
|
||||
(defn update-flex-child
|
||||
[shape scale]
|
||||
(-> shape
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user