From d8838d3fc955da9da8ed653c7af2f33ca1889bb7 Mon Sep 17 00:00:00 2001 From: "mathieu.brunot" Date: Thu, 21 Feb 2019 22:38:54 +0100 Subject: [PATCH] :bug: Use canvas background in viewer --- frontend/src/uxbox/view/ui/viewer/canvas.cljs | 11 ++++++----- 1 file changed, 6 insertions(+), 5 deletions(-) diff --git a/frontend/src/uxbox/view/ui/viewer/canvas.cljs b/frontend/src/uxbox/view/ui/viewer/canvas.cljs index 2da592c95..ea458fdde 100644 --- a/frontend/src/uxbox/view/ui/viewer/canvas.cljs +++ b/frontend/src/uxbox/view/ui/viewer/canvas.cljs @@ -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))))]]))