mirror of
https://github.com/penpot/penpot.git
synced 2025-06-06 20:41:37 +02:00
🐛 Fix problem with thumbnails not working
This commit is contained in:
parent
491748af9f
commit
7a253dc9e4
1 changed files with 8 additions and 1 deletions
|
@ -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))]
|
||||||
|
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue