mirror of
https://github.com/penpot/penpot.git
synced 2026-09-10 22:19:19 +00:00
🐛 Fix problem with text grow types
This commit is contained in:
parent
aadc1aac1c
commit
239af4fb82
@ -382,7 +382,19 @@
|
|||||||
|
|
||||||
get-modifier
|
get-modifier
|
||||||
(fn [shape]
|
(fn [shape]
|
||||||
(ctm/change-dimensions-modifiers shape attr value))
|
(let [modifiers (ctm/change-dimensions-modifiers shape attr value)]
|
||||||
|
;; For text shapes, also update grow-type based on the resize
|
||||||
|
(if (cfh/text-shape? shape)
|
||||||
|
(let [{sr-width :width sr-height :height} (:selrect shape)
|
||||||
|
new-width (if (= attr :width) value sr-width)
|
||||||
|
new-height (if (= attr :height) value sr-height)
|
||||||
|
scalev (gpt/point (/ new-width sr-width) (/ new-height sr-height))
|
||||||
|
current-grow-type (dm/get-prop shape :grow-type)
|
||||||
|
new-grow-type (dwm/next-grow-type current-grow-type scalev)]
|
||||||
|
(cond-> modifiers
|
||||||
|
(not= new-grow-type current-grow-type)
|
||||||
|
(ctm/change-property :grow-type new-grow-type)))
|
||||||
|
modifiers)))
|
||||||
|
|
||||||
modif-tree
|
modif-tree
|
||||||
(-> (dwm/build-modif-tree ids objects get-modifier)
|
(-> (dwm/build-modif-tree ids objects get-modifier)
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user