0
Fork 0
mirror of https://github.com/penpot/penpot.git synced 2025-02-24 07:46:13 -05:00

Add support for export pages with images.

This commit is contained in:
Andrey Antukh 2016-10-24 22:54:45 +02:00
parent 459705e26a
commit 97b30b0b68
No known key found for this signature in database
GPG key ID: 4DFEBCB8316A8B95

View file

@ -13,8 +13,11 @@
[uxbox.main.ui.shapes.group :refer (group-shape)]
[uxbox.main.ui.shapes.path :refer (path-shape)]
[uxbox.main.ui.shapes.circle :refer (circle-shape)]
[uxbox.main.ui.shapes.image :refer (image-shape)]
[uxbox.util.mixins :as mx :include-macros true]))
(def ^:dynamic *state* st/state)
(mx/defc background
[]
[:rect
@ -34,17 +37,21 @@
:icon (icon-shape s)
:rect (rect-shape s)
:path (path-shape s)
:circle (circle-shape s)))
:circle (circle-shape s)
:image (let [image-id (:image s)
image (get-in @*state* [:images-by-id image-id])]
(image-shape (assoc s :image image)))))
(mx/defc shape
[sid]
(shape* (get-in @st/state [:shapes-by-id sid])))
(shape* (get-in @*state* [:shapes-by-id sid])))
(mx/defc page-svg
[{:keys [width height] :as page}]
[:svg {:width width
:height height
:version "1.1"
:xmlnsXlink "http://www.w3.org/1999/xlink"
:xmlns "http://www.w3.org/2000/svg"}
(background)
(for [item (reverse (:shapes page))]