Explorar o código

fix(editor): display of embedded drawing

See-also #9533
Andelf %!s(int64=2) %!d(string=hai) anos
pai
achega
bc4b09d877
Modificáronse 1 ficheiros con 4 adicións e 1 borrados
  1. 4 1
      src/main/frontend/extensions/excalidraw.cljs

+ 4 - 1
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