0
Fork 0
mirror of https://github.com/penpot/penpot.git synced 2025-02-09 08:38:15 -05:00

🐛 Fix 404 error on fills

This commit is contained in:
alonso.torres 2022-03-01 09:52:17 +01:00
parent 7962c104b6
commit 8d700491da
2 changed files with 6 additions and 3 deletions

View file

@ -34,6 +34,7 @@
(rx/map identity obs))) (rx/map identity obs)))
sub (->> (rx/from urls) sub (->> (rx/from urls)
(rx/filter some?)
(url-mapping) (url-mapping)
(rx/reduce conj {}) (rx/reduce conj {})
(rx/subs (fn [data] (rx/subs (fn [data]

View file

@ -30,9 +30,11 @@
(let [{:keys [x y width height]} (:selrect shape) (let [{:keys [x y width height]} (:selrect shape)
{:keys [metadata]} shape {:keys [metadata]} shape
has-image (or metadata (:fill-image shape)) has-image? (or metadata (:fill-image shape))
uri (if metadata uri (cond
metadata
(cfg/resolve-file-media metadata) (cfg/resolve-file-media metadata)
(: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)
@ -66,7 +68,7 @@
(obj/set! "width" width) (obj/set! "width" width)
(obj/set! "height" height))]) (obj/set! "height" height))])
(when has-image (when has-image?
[:image {:xlinkHref (get embed uri uri) [:image {:xlinkHref (get embed uri uri)
:width width :width width
:height height}])]])]))))) :height height}])]])])))))