mirror of
https://github.com/penpot/penpot.git
synced 2025-01-10 08:50:57 -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)))))
|
(->> (:shapes cell) (map #(vector % cell)))))
|
||||||
(:layout-grid-cells parent))
|
(:layout-grid-cells parent))
|
||||||
|
|
||||||
|
children (->> children (remove #(ctl/layout-absolute? (second %))))
|
||||||
children-map
|
children-map
|
||||||
(into {}
|
(into {}
|
||||||
(map #(vector (:id (second %)) %))
|
(map #(vector (:id (second %)) %))
|
||||||
|
|
|
@ -154,9 +154,10 @@
|
||||||
(gpt/add (gpt/to-vec from-h to-h))
|
(gpt/add (gpt/to-vec from-h to-h))
|
||||||
(gpt/add (gpt/to-vec from-v to-v)))]
|
(gpt/add (gpt/to-vec from-v to-v)))]
|
||||||
|
|
||||||
(-> (ctm/empty)
|
(cond-> (ctm/empty)
|
||||||
(ctm/add-modifiers fill-modifiers)
|
(not (ctl/layout-absolute? child))
|
||||||
(ctm/move position-delta))))
|
(-> (ctm/add-modifiers fill-modifiers)
|
||||||
|
(ctm/move position-delta)))))
|
||||||
|
|
||||||
|
|
||||||
(defn line-value
|
(defn line-value
|
||||||
|
|
|
@ -300,13 +300,13 @@
|
||||||
transformed-parent-bounds (delay (gtr/transform-bounds @(get bounds parent-id) modifiers))
|
transformed-parent-bounds (delay (gtr/transform-bounds @(get bounds parent-id) modifiers))
|
||||||
|
|
||||||
children-modifiers
|
children-modifiers
|
||||||
(if flex-layout?
|
(if (or flex-layout? grid-layout?)
|
||||||
(->> (:shapes parent)
|
(->> (:shapes parent)
|
||||||
(filter #(ctl/layout-absolute? objects %)))
|
(filter #(ctl/layout-absolute? objects %)))
|
||||||
(:shapes parent))
|
(:shapes parent))
|
||||||
|
|
||||||
children-layout
|
children-layout
|
||||||
(when flex-layout?
|
(when (or flex-layout? grid-layout?)
|
||||||
(->> (:shapes parent)
|
(->> (:shapes parent)
|
||||||
(remove #(ctl/layout-absolute? objects %))))]
|
(remove #(ctl/layout-absolute? objects %))))]
|
||||||
|
|
||||||
|
|
|
@ -184,6 +184,7 @@
|
||||||
(update :shapes #(d/removev selected %))
|
(update :shapes #(d/removev selected %))
|
||||||
(ctl/assign-cells))
|
(ctl/assign-cells))
|
||||||
|
|
||||||
|
selected (->> selected (remove #(ctl/layout-absolute? objects %)))
|
||||||
frame (-> frame
|
frame (-> frame
|
||||||
(update :shapes d/concat-vec selected)
|
(update :shapes d/concat-vec selected)
|
||||||
(cond-> (some? cell)
|
(cond-> (some? cell)
|
||||||
|
|
Loading…
Reference in a new issue