mirror of
https://github.com/penpot/penpot.git
synced 2026-03-27 22:00:35 +01:00
✨ Select on track row/column selects cells
This commit is contained in:
@@ -1146,22 +1146,30 @@
|
||||
|
||||
(assoc parent :shapes (into [] (reverse new-shapes)))))
|
||||
|
||||
(defn shapes-by-row
|
||||
(defn cells-by-row
|
||||
[parent index]
|
||||
(->> (:layout-grid-cells parent)
|
||||
(filter (fn [[_ {:keys [row row-span]}]]
|
||||
(and (>= (inc index) row)
|
||||
(< (inc index) (+ row row-span)))))
|
||||
(map second)
|
||||
(mapcat :shapes)))
|
||||
(map second)))
|
||||
|
||||
(defn shapes-by-column
|
||||
(defn cells-by-column
|
||||
[parent index]
|
||||
(->> (:layout-grid-cells parent)
|
||||
(filter (fn [[_ {:keys [column column-span]}]]
|
||||
(and (>= (inc index) column)
|
||||
(< (inc index) (+ column column-span)))))
|
||||
(map second)
|
||||
(map second)))
|
||||
|
||||
(defn shapes-by-row
|
||||
[parent index]
|
||||
(->> (cells-by-row parent index)
|
||||
(mapcat :shapes)))
|
||||
|
||||
(defn shapes-by-column
|
||||
[parent index]
|
||||
(->> (cells-by-column parent index)
|
||||
(mapcat :shapes)))
|
||||
|
||||
(defn cells-coordinates
|
||||
|
||||
Reference in New Issue
Block a user