mirror of
https://github.com/penpot/penpot.git
synced 2025-07-25 15:47:18 +02:00
✨ Fix problems with extreme values
This commit is contained in:
parent
999af63118
commit
ed9400912c
59 changed files with 359 additions and 340 deletions
|
@ -7,7 +7,6 @@
|
|||
(ns app.util.code-gen
|
||||
(:require
|
||||
[app.common.data :as d]
|
||||
[app.common.math :as mth]
|
||||
[app.common.text :as txt]
|
||||
[app.util.color :as uc]
|
||||
[cuerdas.core :as str]))
|
||||
|
@ -109,7 +108,7 @@
|
|||
(every? #(or (nil? %) (= % 0)) value)
|
||||
(or (nil? value) (= value 0))))
|
||||
|
||||
default-format (fn [value] (str (mth/precision value 2) "px"))
|
||||
default-format (fn [value] (str value "px"))
|
||||
format-property (fn [prop]
|
||||
(let [css-prop (or (prop to-prop) (name prop))
|
||||
format-fn (or (prop format) default-format)
|
||||
|
|
|
@ -9,7 +9,6 @@
|
|||
[app.common.data :as d]
|
||||
[app.common.geom.point :as gpt]
|
||||
[app.common.geom.shapes.path :as upg]
|
||||
[app.common.math :as mth]
|
||||
[app.common.path.commands :as upc]
|
||||
[clojure.set :as set]))
|
||||
|
||||
|
@ -402,9 +401,7 @@
|
|||
(rest segments))))))
|
||||
|
||||
(defn calculate-merge-points [group-segments points]
|
||||
(let [index-merge-point (fn [group] (vector group (-> (gpt/center-points group)
|
||||
(update :x mth/round)
|
||||
(update :y mth/round))))
|
||||
(let [index-merge-point (fn [group] (vector group (gpt/center-points group)))
|
||||
index-group (fn [point] (vector point (d/seek #(contains? % point) group-segments)))
|
||||
|
||||
group->merge-point (into {} (map index-merge-point) group-segments)
|
||||
|
|
|
@ -8,7 +8,7 @@
|
|||
"Performance profiling for react components."
|
||||
(:require-macros [app.util.perf])
|
||||
(:require
|
||||
[app.common.math :as math]
|
||||
[app.common.math :as mth]
|
||||
[rumext.alpha :as mf]
|
||||
[goog.functions :as f]
|
||||
["react" :as react]
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue