From b6e04b8c39ae6bf0e06e196887d68121da00d5fc Mon Sep 17 00:00:00 2001 From: Andrey Antukh Date: Thu, 10 Nov 2016 18:33:18 +0100 Subject: [PATCH] Add missing attributes when page is exported as svg. --- src/uxbox/main/exports.cljs | 22 ++++++++++++---------- 1 file changed, 12 insertions(+), 10 deletions(-) diff --git a/src/uxbox/main/exports.cljs b/src/uxbox/main/exports.cljs index 4dd769c31..261b51e83 100644 --- a/src/uxbox/main/exports.cljs +++ b/src/uxbox/main/exports.cljs @@ -47,16 +47,18 @@ (shape* (get-in @*state* [:shapes 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))] - (-> (shape item) - (mx/with-key (str item))))]) + [{:keys [metadata] :as page}] + (let [{:keys [width height]} metadata] + [:svg {:width width + :height height + :view-box (str "0 0 " width " " height) + :version "1.1" + :xmlnsXlink "http://www.w3.org/1999/xlink" + :xmlns "http://www.w3.org/2000/svg"} + #_(background) + (for [item (reverse (:shapes page))] + (-> (shape item) + (mx/with-key (str item))))])) (defn render-page [id]