mirror of
https://github.com/penpot/penpot.git
synced 2025-07-23 22:57:19 +02:00
♻️ Ensure a correct usage of concat/into operations.
This commit is contained in:
parent
b897f202dd
commit
6a7600fd52
42 changed files with 461 additions and 383 deletions
|
@ -60,14 +60,14 @@
|
|||
param-list (extract-params cmd [[:x :number]
|
||||
[:y :number]])]
|
||||
|
||||
(d/concat [{:command :move-to
|
||||
:relative relative
|
||||
:params (first param-list)}]
|
||||
(into [{:command :move-to
|
||||
:relative relative
|
||||
:params (first param-list)}]
|
||||
|
||||
(for [params (rest param-list)]
|
||||
{:command :line-to
|
||||
:relative relative
|
||||
:params params}))))
|
||||
(for [params (rest param-list)]
|
||||
{:command :line-to
|
||||
:relative relative
|
||||
:params params}))))
|
||||
|
||||
(defmethod parse-command "Z" [_]
|
||||
[{:command :close-path}])
|
||||
|
@ -259,7 +259,7 @@
|
|||
(update :params merge (quadratic->curve prev-pos (gpt/point params) (upg/calculate-opposite-handler prev-pos prev-qc)))))
|
||||
|
||||
result (if (= :elliptical-arc (:command command))
|
||||
(d/concat result (arc->beziers prev-pos command))
|
||||
(into result (arc->beziers prev-pos command))
|
||||
(conj result command))
|
||||
|
||||
next-cc (case (:command orig-command)
|
||||
|
|
|
@ -304,7 +304,7 @@
|
|||
[content points]
|
||||
|
||||
(let [segments-set (into #{}
|
||||
(map (fn [{:keys [start end]}] [start end]))
|
||||
(juxt :start :end)
|
||||
(get-segments content points))
|
||||
|
||||
create-line-command (fn [point other]
|
||||
|
@ -318,7 +318,7 @@
|
|||
(flatten)
|
||||
(into []))]
|
||||
|
||||
(d/concat content new-content)))
|
||||
(into content new-content)))
|
||||
|
||||
|
||||
(defn separate-nodes
|
||||
|
|
|
@ -630,8 +630,7 @@
|
|||
(defn find-node-references [node]
|
||||
(let [current (->> (find-attr-references (:attrs node)) (into #{}))
|
||||
children (->> (:content node) (map find-node-references) (flatten) (into #{}))]
|
||||
(-> (d/concat current children)
|
||||
(vec))))
|
||||
(vec (into current children))))
|
||||
|
||||
(defn find-def-references [defs references]
|
||||
(loop [result (into #{} references)
|
||||
|
@ -653,7 +652,7 @@
|
|||
(let [node (get defs to-check)
|
||||
new-refs (find-node-references node)
|
||||
pending (concat pending new-refs)]
|
||||
(recur (d/concat result new-refs)
|
||||
(recur (into result new-refs)
|
||||
(conj checked? to-check)
|
||||
(first pending)
|
||||
(rest pending))))))
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue