🐛 Fix copying layout values with only multiple decimals

This commit is contained in:
Eva 2022-05-05 14:42:22 +02:00 committed by Andrés Moya
parent 1102bc9cba
commit 37fdf51eaf
2 changed files with 14 additions and 12 deletions

View file

@ -8,6 +8,7 @@
(:require
[app.common.data :as d]
[app.common.text :as txt]
[app.main.ui.formats :as fmt]
[app.util.color :as uc]
[cuerdas.core :as str]))
@ -108,7 +109,7 @@
(every? #(or (nil? %) (= % 0)) value)
(or (nil? value) (= value 0))))
default-format (fn [value] (str value "px"))
default-format (fn [value] (str (fmt/format-pixels value)))
format-property (fn [prop]
(let [css-prop (or (prop to-prop) (name prop))
format-fn (or (prop format) default-format)