Select on track row/column selects cells

This commit is contained in:
alonso.torres
2023-12-05 16:42:48 +01:00
parent 88d259a123
commit c609d2dec6
4 changed files with 60 additions and 14 deletions

View File

@@ -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