mirror of
https://github.com/penpot/penpot.git
synced 2025-03-12 07:41:43 -05:00
🐛 Make the width and height min value to 1px.
This commit is contained in:
parent
3db9907c25
commit
e73a8a2f7e
2 changed files with 29 additions and 32 deletions
|
@ -20,6 +20,7 @@
|
|||
[app.main.data.workspace :as udw]
|
||||
[app.main.ui.icons :as i]
|
||||
[app.main.ui.components.dropdown :refer [dropdown]]
|
||||
[app.main.ui.components.numeric-input :refer [numeric-input]]
|
||||
[app.main.ui.workspace.sidebar.options.fill :refer [fill-attrs fill-menu]]
|
||||
[app.main.ui.workspace.sidebar.options.stroke :refer [stroke-attrs stroke-menu]]
|
||||
[app.main.ui.workspace.sidebar.options.frame-grid :refer [frame-grid]]
|
||||
|
@ -51,7 +52,7 @@
|
|||
(fn [event attr]
|
||||
(let [value (-> (dom/get-target event)
|
||||
(dom/get-value)
|
||||
(d/parse-integer 0))]
|
||||
(d/parse-integer 1))]
|
||||
(st/emit! (udw/update-dimensions [(:id shape)] attr value))))
|
||||
|
||||
on-proportion-lock-change
|
||||
|
@ -104,38 +105,34 @@
|
|||
i/lock
|
||||
i/unlock)]
|
||||
[:div.input-element.pixels
|
||||
[:input.input-text {:type "number"
|
||||
:min "0"
|
||||
[:> numeric-input {:min "1"
|
||||
:on-click select-all
|
||||
:on-change on-width-change
|
||||
:value (-> (:width shape)
|
||||
(math/precision 2)
|
||||
(d/coalesce-str "0"))}]]
|
||||
(d/coalesce-str "1"))}]]
|
||||
|
||||
|
||||
[:div.input-element.pixels
|
||||
[:input.input-text {:type "number"
|
||||
:min "0"
|
||||
[:> numeric-input {:min "1"
|
||||
:on-click select-all
|
||||
:on-change on-height-change
|
||||
:value (-> (:height shape)
|
||||
(math/precision 2)
|
||||
(d/coalesce-str "0"))}]]]
|
||||
(d/coalesce-str "1"))}]]]
|
||||
|
||||
;; POSITION
|
||||
[:div.row-flex
|
||||
[:span.element-set-subtitle (tr "workspace.options.position")]
|
||||
[:div.input-element.pixels
|
||||
[:input.input-text {:placeholder "x"
|
||||
:type "number"
|
||||
[:> numeric-input {:placeholder "x"
|
||||
:on-click select-all
|
||||
:on-change on-pos-x-change
|
||||
:value (-> (:x shape)
|
||||
(math/precision 2)
|
||||
(d/coalesce-str "0"))}]]
|
||||
[:div.input-element.pixels
|
||||
[:input.input-text {:placeholder "y"
|
||||
:type "number"
|
||||
[:> numeric-input {:placeholder "y"
|
||||
:on-click select-all
|
||||
:on-change on-pos-y-change
|
||||
:value (-> (:y shape)
|
||||
|
|
|
@ -60,7 +60,7 @@
|
|||
(fn [event attr]
|
||||
(let [value (-> (dom/get-target event)
|
||||
(dom/get-value)
|
||||
(d/parse-integer 0))]
|
||||
(d/parse-integer 1))]
|
||||
(st/emit! (udw/update-dimensions ids attr value))))
|
||||
|
||||
on-proportion-lock-change
|
||||
|
@ -120,7 +120,7 @@
|
|||
[:div.row-flex
|
||||
[:span.element-set-subtitle (t locale "workspace.options.size")]
|
||||
[:div.input-element.width
|
||||
[:> numeric-input {:min "0"
|
||||
[:> numeric-input {:min "1"
|
||||
:no-validate true
|
||||
:placeholder "--"
|
||||
:on-click select-all
|
||||
|
@ -128,7 +128,7 @@
|
|||
:value (attr->string :width values)}]]
|
||||
|
||||
[:div.input-element.height
|
||||
[:> numeric-input {:min "0"
|
||||
[:> numeric-input {:min "1"
|
||||
:no-validate true
|
||||
:placeholder "--"
|
||||
:on-click select-all
|
||||
|
|
Loading…
Add table
Reference in a new issue