🐛 Fix some problems with layouts

This commit is contained in:
alonso.torres 2025-05-21 10:41:42 +02:00
parent 6cd2c712ab
commit 5d42b9793b
6 changed files with 30 additions and 7 deletions

View file

@ -262,10 +262,10 @@
[x y width height]
(if (features/active-feature? @st/state "render-wasm/v1")
(let [{:keys [width height]} (wasm.api/text-dimensions shape-id)
(let [{:keys [max-width height]} (wasm.api/text-dimensions shape-id)
{:keys [x y]} (:selrect shape)]
[x y width height])
[x y max-width height])
(let [bounds (gst/shape->rect shape)
x (mth/min (dm/get-prop bounds :x)

View file

@ -620,9 +620,10 @@
(let [offset (h/call wasm/internal-module "_get_text_dimensions")
heapf32 (mem/get-heap-f32)
width (aget heapf32 (mem/ptr8->ptr32 offset))
height (aget heapf32 (mem/ptr8->ptr32 (+ offset 4)))]
height (aget heapf32 (mem/ptr8->ptr32 (+ offset 4)))
max-width (aget heapf32 (mem/ptr8->ptr32 (+ offset 8)))]
(h/call wasm/internal-module "_free_bytes")
{:width width :height height})))
{:width width :height height :max-width max-width})))
(defn set-view-box
[zoom vbox]