0
Fork 0
mirror of https://github.com/penpot/penpot.git synced 2025-03-12 15:51:37 -05:00

🐛 Use canvas background in viewer

This commit is contained in:
mathieu.brunot 2019-02-21 22:38:54 +01:00
parent 6439d64b72
commit d8838d3fc9
No known key found for this signature in database
GPG key ID: 81584BEAF692D7E0

View file

@ -12,12 +12,13 @@
;; --- Background (Component)
(mx/defc background
[]
{:mixins [mx/static]}
[{:keys [background] :as metadata}]
[:rect
{:x 0 :y 0
:width "100%"
:height "100%"
:fill "white"}])
:fill (or background "#ffffff")}])
;; --- Canvas (Component)
@ -25,12 +26,12 @@
(mx/defc canvas
{:mixins [mx/static]}
[{:keys [metadata] :as page}]
[{:keys [metadata id] :as page}]
(let [{:keys [width height]} metadata]
[:div.view-canvas
[:div.view-canvas {:ref (str "canvas" id)}
[:svg.page-layout {:width width
:height height}
(background)
(background metadata)
(for [id (reverse (:shapes page))]
(-> (shapes/shape id)
(mx/with-key (str id))))]]))