mirror of
https://github.com/penpot/penpot.git
synced 2025-04-01 01:21:21 -05:00
💄 Cosmetic changes on pages helpers namespace.
This commit is contained in:
parent
9445e3abb8
commit
357e779013
1 changed files with 9 additions and 12 deletions
|
@ -262,19 +262,16 @@
|
||||||
"Retrieves a list with the indexes for each element in the layer tree.
|
"Retrieves a list with the indexes for each element in the layer tree.
|
||||||
This will be used for shift+selection."
|
This will be used for shift+selection."
|
||||||
[objects]
|
[objects]
|
||||||
(let [rec-index
|
(letfn [(red-fn [cur-idx id]
|
||||||
(fn rec-index [cur-idx id]
|
(let [[prev-idx _] (first cur-idx)
|
||||||
(let [object (get objects id)
|
prev-idx (or prev-idx 0)
|
||||||
red-fn
|
cur-idx (conj cur-idx [(inc prev-idx) id])]
|
||||||
(fn [cur-idx id]
|
(rec-index cur-idx id)))
|
||||||
(let [[prev-idx _] (first cur-idx)
|
(rec-index [cur-idx id]
|
||||||
prev-idx (or prev-idx 0)
|
(let [object (get objects id)]
|
||||||
cur-idx (conj cur-idx [(inc prev-idx) id])]
|
(reduce red-fn cur-idx (reverse (:shapes object)))))]
|
||||||
(rec-index cur-idx id)))]
|
|
||||||
(reduce red-fn cur-idx (reverse (:shapes object)))))]
|
|
||||||
(into {} (rec-index '() uuid/zero))))
|
(into {} (rec-index '() uuid/zero))))
|
||||||
|
|
||||||
|
|
||||||
(defn expand-region-selection
|
(defn expand-region-selection
|
||||||
"Given a selection selects all the shapes between the first and last in
|
"Given a selection selects all the shapes between the first and last in
|
||||||
an indexed manner (shift selection)"
|
an indexed manner (shift selection)"
|
||||||
|
@ -285,7 +282,7 @@
|
||||||
(map first))
|
(map first))
|
||||||
|
|
||||||
from (apply min filter-indexes)
|
from (apply min filter-indexes)
|
||||||
to (apply max filter-indexes)]
|
to (apply max filter-indexes)]
|
||||||
(->> indexed-shapes
|
(->> indexed-shapes
|
||||||
(filter (fn [[idx _]] (and (>= idx from) (<= idx to))))
|
(filter (fn [[idx _]] (and (>= idx from) (<= idx to))))
|
||||||
(map second)
|
(map second)
|
||||||
|
|
Loading…
Add table
Reference in a new issue