From bc4b09d877ee4c09552a65ae289786171a0746aa Mon Sep 17 00:00:00 2001 From: Andelf Date: Wed, 2 Aug 2023 18:05:39 +0800 Subject: [PATCH] fix(editor): display of embedded drawing See-also #9533 --- src/main/frontend/extensions/excalidraw.cljs | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/src/main/frontend/extensions/excalidraw.cljs b/src/main/frontend/extensions/excalidraw.cljs index 7527f4bbcf..c6fdc3a8cd 100644 --- a/src/main/frontend/extensions/excalidraw.cljs +++ b/src/main/frontend/extensions/excalidraw.cljs @@ -41,7 +41,10 @@ nil (.. el -classList (contains "block-content")) - (let [width (.-clientWidth el)] + (let [client-width (.-clientWidth el) + width (if (zero? client-width) + (.-width (.-getBoundingClientRect el)) + client-width)] (reset! (::draw-width state) width)) :else