0
Fork 0
mirror of https://github.com/penpot/penpot.git synced 2025-03-18 02:32:13 -05:00

🐛 Fix rounding problem with texts

This commit is contained in:
alonso.torres 2022-04-18 09:54:54 +02:00
parent 82ae4e60f8
commit 875fd78f73

View file

@ -8,7 +8,6 @@
(:require
[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]
@ -52,12 +51,12 @@
[:> :g group-props
(for [[index data] (d/enumerate position-data)]
(let [y (if (cfg/check-browser? :safari)
(mth/round (- (:y data) (:height data)))
(mth/round (:y data)))
(- (:y data) (:height data))
(: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))
props (-> #js {:x (:x data)
:y y
:alignmentBaseline alignment-bl
:dominantBaseline dominant-bl