mirror of
https://github.com/penpot/penpot.git
synced 2025-05-18 23:06:11 +02:00
Add proportion lock to icons
This commit is contained in:
parent
2f968fe50b
commit
45f48b073c
1 changed files with 9 additions and 2 deletions
|
@ -40,7 +40,11 @@
|
|||
value (parse-int value nil)
|
||||
sid (:id shape)
|
||||
props {attr value}]
|
||||
(st/emit! (uds/update-position sid props))))]
|
||||
(st/emit! (uds/update-position sid props))))
|
||||
(on-proportion-lock-change [event]
|
||||
(if (:proportion-lock shape)
|
||||
(st/emit! (uds/unlock-proportions (:id shape)))
|
||||
(st/emit! (uds/lock-proportions (:id shape)))))]
|
||||
(let [size (geom/size shape)]
|
||||
(html
|
||||
[:div.element-set {:key (str (:id menu))}
|
||||
|
@ -56,7 +60,10 @@
|
|||
:min "0"
|
||||
:value (precision (:width size) 2)
|
||||
:on-change (partial on-size-change :width)}]]
|
||||
[:div.lock-size i/lock]
|
||||
[:div.lock-size
|
||||
{:class (when (:proportion-lock shape) "selected")
|
||||
:on-click on-proportion-lock-change}
|
||||
i/lock]
|
||||
[:div.input-element.pixels
|
||||
[:input.input-text
|
||||
{:placeholder "Height"
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue