From ea38d12a73710f27a8de3445e014ae3f9783094d Mon Sep 17 00:00:00 2001 From: "alonso.torres" Date: Fri, 1 Apr 2022 21:26:58 +0200 Subject: [PATCH] :bug: Fix problem with exported text --- frontend/src/app/main/ui/shapes/text/svg_text.cljs | 14 +++++++++++--- 1 file changed, 11 insertions(+), 3 deletions(-) diff --git a/frontend/src/app/main/ui/shapes/text/svg_text.cljs b/frontend/src/app/main/ui/shapes/text/svg_text.cljs index b2747ab37..f9849c9d0 100644 --- a/frontend/src/app/main/ui/shapes/text/svg_text.cljs +++ b/frontend/src/app/main/ui/shapes/text/svg_text.cljs @@ -9,6 +9,7 @@ [app.common.data :as d] [app.common.geom.shapes :as gsh] [app.common.math :as mth] + [app.config :as cfg] [app.main.ui.context :as muc] [app.main.ui.shapes.attrs :as attrs] [app.main.ui.shapes.custom-stroke :refer [shape-custom-strokes]] @@ -50,9 +51,16 @@ [:> :g group-props (for [[index data] (d/enumerate position-data)] - (let [props (-> #js {:x (mth/round (:x data)) - :y (mth/round (- (:y data) (:height data))) - :alignmentBaseline "text-before-edge" + (let [y (if (cfg/check-browser? :safari) + (mth/round (- (:y data) (:height data))) + (mth/round (:y data))) + + alignment-bl (when (cfg/check-browser? :safari) "text-before-edge") + dominant-bl (when-not (cfg/check-browser? :safari) "ideographic") + props (-> #js {:x (mth/round (:x data)) + :y y + :alignmentBaseline alignment-bl + :dominantBaseline dominant-bl :style (-> #js {:fontFamily (:font-family data) :fontSize (:font-size data) :fontWeight (:font-weight data)