🐛 Fix problem with thumbnails not working

This commit is contained in:
alonso.torres 2022-03-15 11:17:06 +01:00
parent 491748af9f
commit 7a253dc9e4

View file

@ -31,19 +31,26 @@
{:keys [metadata]} shape {:keys [metadata]} shape
has-image? (or metadata (:fill-image shape)) has-image? (or metadata (:fill-image shape))
uri (cond uri (cond
metadata metadata
(cfg/resolve-file-media metadata) (cfg/resolve-file-media metadata)
(:fill-image shape) (:fill-image shape)
(cfg/resolve-file-media (:fill-image shape))) (cfg/resolve-file-media (:fill-image shape)))
embed (embed/use-data-uris [uri]) embed (embed/use-data-uris [uri])
transform (gsh/transform-matrix shape) transform (gsh/transform-matrix shape)
;; When true the image has not loaded yet
loading? (and (some? uri) (not (contains? embed uri)))
pattern-attrs (cond-> #js {:patternUnits "userSpaceOnUse" pattern-attrs (cond-> #js {:patternUnits "userSpaceOnUse"
:x x :x x
:y y :y y
:height height :height height
:width width :width width
:data-loading (str (not (contains? embed uri)))} :data-loading loading?}
(= :path (:type shape)) (= :path (:type shape))
(obj/set! "patternTransform" transform))] (obj/set! "patternTransform" transform))]