From b2bde8d97ef9e0b1d89ce0a1527be60443198b22 Mon Sep 17 00:00:00 2001 From: "alonso.torres" Date: Fri, 29 Jan 2021 15:51:03 +0100 Subject: [PATCH] :sparkles: Improvements over svg export --- frontend/resources/locales.json | 9 ++++++- frontend/src/app/main/ui/render.cljs | 24 ++++++++++--------- .../ui/workspace/sidebar/options/exports.cljs | 1 + 3 files changed, 22 insertions(+), 12 deletions(-) diff --git a/frontend/resources/locales.json b/frontend/resources/locales.json index ef9428dcf..923718fec 100644 --- a/frontend/resources/locales.json +++ b/frontend/resources/locales.json @@ -4410,5 +4410,12 @@ "es" : "Pulsar para cerrar la ruta" }, "unused" : true - } + }, + + "workspace.options.export.suffix": { + "translations" : { + "en" : "Suffix", + "es" : "Sufijo" + } + } } diff --git a/frontend/src/app/main/ui/render.cljs b/frontend/src/app/main/ui/render.cljs index 35612bdab..e02da77e2 100644 --- a/frontend/src/app/main/ui/render.cljs +++ b/frontend/src/app/main/ui/render.cljs @@ -18,6 +18,7 @@ [app.common.geom.shapes :as geom] [app.common.geom.point :as gpt] [app.common.geom.matrix :as gmt] + [app.main.ui.context :as muc] [app.main.exports :as exports] [app.main.repo :as repo])) @@ -65,17 +66,18 @@ #(exports/shape-wrapper-factory objects)) ] - [:svg {:id "screenshot" - :view-box vbox - :width width - :height height - :version "1.1" - :xmlnsXlink "http://www.w3.org/1999/xlink" - :xmlns "http://www.w3.org/2000/svg"} - (case (:type object) - :frame [:& frame-wrapper {:shape object :view-box vbox}] - :group [:& group-wrapper {:shape object}] - [:& shape-wrapper {:shape object}])])) + [:& (mf/provider muc/embed-ctx) {:value true} + [:svg {:id "screenshot" + :view-box vbox + :width width + :height height + :version "1.1" + :xmlnsXlink "http://www.w3.org/1999/xlink" + :xmlns "http://www.w3.org/2000/svg"} + (case (:type object) + :frame [:& frame-wrapper {:shape object :view-box vbox}] + :group [:& group-wrapper {:shape object}] + [:& shape-wrapper {:shape object}])]])) (defn- adapt-root-frame [objects object-id] diff --git a/frontend/src/app/main/ui/workspace/sidebar/options/exports.cljs b/frontend/src/app/main/ui/workspace/sidebar/options/exports.cljs index 8dc48bf43..ef5c16f3f 100644 --- a/frontend/src/app/main/ui/workspace/sidebar/options/exports.cljs +++ b/frontend/src/app/main/ui/workspace/sidebar/options/exports.cljs @@ -146,6 +146,7 @@ [:option {:value "4"} "4x"] [:option {:value "6"} "6x"]] [:input.input-text {:value (:suffix export) + :placeholder (tr "workspace.options.export.suffix") :on-change (partial on-suffix-change index)}] [:select.input-select {:value (name (:type export)) :on-change (partial on-type-change index)}