mirror of
https://github.com/penpot/penpot.git
synced 2026-08-01 19:06:18 +00:00
🐛 Add a protection for some corner cases
This commit is contained in:
parent
e22ef536ed
commit
30bcdda90e
@ -113,7 +113,9 @@
|
|||||||
(close-attrs? attr val1 val2 mth/float-equal-precision))
|
(close-attrs? attr val1 val2 mth/float-equal-precision))
|
||||||
|
|
||||||
([attr val1 val2 precision]
|
([attr val1 val2 precision]
|
||||||
(let [close-val? (fn [num1 num2] (< (mth/abs (- num1 num2)) precision))]
|
(let [close-val? (fn [num1 num2]
|
||||||
|
(when (and (number? num1) (number? num2))
|
||||||
|
(< (mth/abs (- num1 num2)) precision)))]
|
||||||
(cond
|
(cond
|
||||||
(and (number? val1) (number? val2))
|
(and (number? val1) (number? val2))
|
||||||
(close-val? val1 val2)
|
(close-val? val1 val2)
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user