mirror of
https://github.com/penpot/penpot.git
synced 2026-05-04 23:59:12 +00:00
🐛 Fix incorrect type coerce operations (#7168)
A regression introduced in previous commits that causes a browser tab totally killed by memory usage.
This commit is contained in:
parent
3f93b0d44b
commit
0e4cf23a93
@ -96,10 +96,9 @@
|
||||
(if (and (some? layout-line) (<= from-idx max-idx))
|
||||
(let [to-idx (+ from-idx (:num-children layout-line))
|
||||
children (subvec children from-idx to-idx)
|
||||
|
||||
[_ modif-tree]
|
||||
(reduce set-child-modifiers [layout-line modif-tree] children)]
|
||||
(recur modif-tree (first pending) (rest pending) (long to-idx)))
|
||||
(recur modif-tree (first pending) (rest pending) to-idx))
|
||||
|
||||
modif-tree)))))
|
||||
|
||||
|
||||
@ -177,7 +177,7 @@
|
||||
(rest children)))))]
|
||||
|
||||
(recur next-areas
|
||||
(+ from-idx (long (:num-children current-line)))
|
||||
(+ from-idx (:num-children current-line))
|
||||
(+ (:x line-area) (:width line-area))
|
||||
(+ (:y line-area) (:height line-area))
|
||||
(rest lines)))))))
|
||||
|
||||
@ -393,17 +393,15 @@
|
||||
defined by the constant num-segments"
|
||||
[start end h1 h2]
|
||||
(let [offset (/ 1 num-segments)
|
||||
tp (fn [t] (curve-values start end h1 h2 t))]
|
||||
(loop [from 0
|
||||
tp (fn [t] (curve-values start end h1 h2 t))]
|
||||
(loop [from 0.0
|
||||
result []]
|
||||
|
||||
(let [to (min 1 (+ from offset))
|
||||
line [(tp from) (tp to)]
|
||||
(let [to (mth/min 1.0 (+ from offset))
|
||||
line [(tp from) (tp to)]
|
||||
result (conj result line)]
|
||||
|
||||
(if (>= to 1)
|
||||
(if (>= to 1.0)
|
||||
result
|
||||
(recur (long to) result))))))
|
||||
(recur (double to) result))))))
|
||||
|
||||
(defn curve-split
|
||||
"Splits a curve into two at the given parametric value `t`.
|
||||
|
||||
@ -190,4 +190,4 @@
|
||||
(recur (first subpath)
|
||||
(rest subpath)
|
||||
first-point
|
||||
(long signed-area)))))))
|
||||
signed-area))))))
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user