mirror of
https://github.com/penpot/penpot.git
synced 2025-03-13 00:01:51 -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)
|
;; --- Background (Component)
|
||||||
|
|
||||||
(mx/defc background
|
(mx/defc background
|
||||||
[]
|
{:mixins [mx/static]}
|
||||||
|
[{:keys [background] :as metadata}]
|
||||||
[:rect
|
[:rect
|
||||||
{:x 0 :y 0
|
{:x 0 :y 0
|
||||||
:width "100%"
|
:width "100%"
|
||||||
:height "100%"
|
:height "100%"
|
||||||
:fill "white"}])
|
:fill (or background "#ffffff")}])
|
||||||
|
|
||||||
;; --- Canvas (Component)
|
;; --- Canvas (Component)
|
||||||
|
|
||||||
|
@ -25,12 +26,12 @@
|
||||||
|
|
||||||
(mx/defc canvas
|
(mx/defc canvas
|
||||||
{:mixins [mx/static]}
|
{:mixins [mx/static]}
|
||||||
[{:keys [metadata] :as page}]
|
[{:keys [metadata id] :as page}]
|
||||||
(let [{:keys [width height]} metadata]
|
(let [{:keys [width height]} metadata]
|
||||||
[:div.view-canvas
|
[:div.view-canvas {:ref (str "canvas" id)}
|
||||||
[:svg.page-layout {:width width
|
[:svg.page-layout {:width width
|
||||||
:height height}
|
:height height}
|
||||||
(background)
|
(background metadata)
|
||||||
(for [id (reverse (:shapes page))]
|
(for [id (reverse (:shapes page))]
|
||||||
(-> (shapes/shape id)
|
(-> (shapes/shape id)
|
||||||
(mx/with-key (str id))))]]))
|
(mx/with-key (str id))))]]))
|
||||||
|
|
Loading…
Add table
Reference in a new issue