0
Fork 0
mirror of https://github.com/penpot/penpot.git synced 2025-01-08 07:50:43 -05:00

Merge pull request #2586 from penpot/hiru-fix-min-size

🐛 Fix min size when creating shapes
This commit is contained in:
Andrey Antukh 2022-11-23 09:39:18 +01:00 committed by GitHub
commit 77a397de0c
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -48,19 +48,19 @@
(cond-> shape
(not click-draw?)
(-> (assoc :grow-type :fixed))
(and click-draw? (not text?))
(-> (assoc :width min-side :height min-side)
(cts/setup-rect-selrect)
(gsh/transform-shape (ctm/move-modifiers (- (/ min-side 2)) (- (/ min-side 2)))))
(and click-draw? text?)
(assoc :height 17 :width 4 :grow-type :auto-width)
click-draw?
(cts/setup-rect-selrect)
(-> (assoc :height 17 :width 4 :grow-type :auto-width)
(cts/setup-rect-selrect))
:always
(dissoc :initialized? :click-draw?))]
;; Add & select the created shape to the workspace
(rx/concat
(if (= :text (:type shape))