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:
parent
6439d64b72
commit
d8838d3fc9
1 changed files with 6 additions and 5 deletions
|
@ -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))))]]))
|
||||
|
|
Loading…
Add table
Reference in a new issue