mirror of
https://github.com/penpot/penpot.git
synced 2026-09-06 12:09:24 +00:00
🐛 Fix changing properties resizes the text box height
This commit is contained in:
parent
ec0dc2931c
commit
a11b0f54d7
@ -56,16 +56,19 @@
|
|||||||
([shape]
|
([shape]
|
||||||
(resize-wasm-text-modifiers shape (:content shape)))
|
(resize-wasm-text-modifiers shape (:content shape)))
|
||||||
|
|
||||||
([{:keys [id points selrect] :as shape} content]
|
([{:keys [id points selrect grow-type] :as shape} content]
|
||||||
(wasm.api/use-shape id)
|
(wasm.api/use-shape id)
|
||||||
(wasm.api/set-shape-text-content id content)
|
(wasm.api/set-shape-text-content id content)
|
||||||
(wasm.api/set-shape-text-images id content)
|
(wasm.api/set-shape-text-images id content)
|
||||||
|
|
||||||
(let [dimension (wasm.api/get-text-dimensions)
|
(let [dimension (wasm.api/get-text-dimensions)
|
||||||
resize-v (gpt/point
|
width-scale (if (#{:fixed :auto-height} grow-type)
|
||||||
(/ (:width dimension) (-> selrect :width))
|
1.0
|
||||||
(/ (:height dimension) (-> selrect :height)))
|
(/ (:width dimension) (:width selrect)))
|
||||||
|
height-scale (if (= :fixed grow-type)
|
||||||
|
1.0
|
||||||
|
(/ (:height dimension) (:height selrect)))
|
||||||
|
resize-v (gpt/point width-scale height-scale)
|
||||||
origin (first points)]
|
origin (first points)]
|
||||||
|
|
||||||
{id
|
{id
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user