mirror of
https://github.com/penpot/penpot.git
synced 2025-01-10 00:40:30 -05:00
✨ Position absolute in grid layout
This commit is contained in:
parent
117a8d09d3
commit
c9b932f954
4 changed files with 8 additions and 5 deletions
|
@ -329,6 +329,7 @@
|
|||
(->> (:shapes cell) (map #(vector % cell)))))
|
||||
(:layout-grid-cells parent))
|
||||
|
||||
children (->> children (remove #(ctl/layout-absolute? (second %))))
|
||||
children-map
|
||||
(into {}
|
||||
(map #(vector (:id (second %)) %))
|
||||
|
|
|
@ -154,9 +154,10 @@
|
|||
(gpt/add (gpt/to-vec from-h to-h))
|
||||
(gpt/add (gpt/to-vec from-v to-v)))]
|
||||
|
||||
(-> (ctm/empty)
|
||||
(ctm/add-modifiers fill-modifiers)
|
||||
(ctm/move position-delta))))
|
||||
(cond-> (ctm/empty)
|
||||
(not (ctl/layout-absolute? child))
|
||||
(-> (ctm/add-modifiers fill-modifiers)
|
||||
(ctm/move position-delta)))))
|
||||
|
||||
|
||||
(defn line-value
|
||||
|
|
|
@ -300,13 +300,13 @@
|
|||
transformed-parent-bounds (delay (gtr/transform-bounds @(get bounds parent-id) modifiers))
|
||||
|
||||
children-modifiers
|
||||
(if flex-layout?
|
||||
(if (or flex-layout? grid-layout?)
|
||||
(->> (:shapes parent)
|
||||
(filter #(ctl/layout-absolute? objects %)))
|
||||
(:shapes parent))
|
||||
|
||||
children-layout
|
||||
(when flex-layout?
|
||||
(when (or flex-layout? grid-layout?)
|
||||
(->> (:shapes parent)
|
||||
(remove #(ctl/layout-absolute? objects %))))]
|
||||
|
||||
|
|
|
@ -184,6 +184,7 @@
|
|||
(update :shapes #(d/removev selected %))
|
||||
(ctl/assign-cells))
|
||||
|
||||
selected (->> selected (remove #(ctl/layout-absolute? objects %)))
|
||||
frame (-> frame
|
||||
(update :shapes d/concat-vec selected)
|
||||
(cond-> (some? cell)
|
||||
|
|
Loading…
Reference in a new issue