mirror of
https://github.com/penpot/penpot.git
synced 2025-01-09 00:10:11 -05:00
Merge pull request #2586 from penpot/hiru-fix-min-size
🐛 Fix min size when creating shapes
This commit is contained in:
commit
77a397de0c
1 changed files with 5 additions and 5 deletions
|
@ -48,19 +48,19 @@
|
||||||
(cond-> shape
|
(cond-> shape
|
||||||
(not click-draw?)
|
(not click-draw?)
|
||||||
(-> (assoc :grow-type :fixed))
|
(-> (assoc :grow-type :fixed))
|
||||||
|
|
||||||
(and click-draw? (not text?))
|
(and click-draw? (not text?))
|
||||||
(-> (assoc :width min-side :height min-side)
|
(-> (assoc :width min-side :height min-side)
|
||||||
|
(cts/setup-rect-selrect)
|
||||||
(gsh/transform-shape (ctm/move-modifiers (- (/ min-side 2)) (- (/ min-side 2)))))
|
(gsh/transform-shape (ctm/move-modifiers (- (/ min-side 2)) (- (/ min-side 2)))))
|
||||||
|
|
||||||
(and click-draw? text?)
|
(and click-draw? text?)
|
||||||
(assoc :height 17 :width 4 :grow-type :auto-width)
|
(-> (assoc :height 17 :width 4 :grow-type :auto-width)
|
||||||
|
(cts/setup-rect-selrect))
|
||||||
click-draw?
|
|
||||||
(cts/setup-rect-selrect)
|
|
||||||
|
|
||||||
:always
|
:always
|
||||||
(dissoc :initialized? :click-draw?))]
|
(dissoc :initialized? :click-draw?))]
|
||||||
|
|
||||||
;; Add & select the created shape to the workspace
|
;; Add & select the created shape to the workspace
|
||||||
(rx/concat
|
(rx/concat
|
||||||
(if (= :text (:type shape))
|
(if (= :text (:type shape))
|
||||||
|
|
Loading…
Reference in a new issue