🐛 Fix fill inside grid layout

This commit is contained in:
alonso.torres 2023-10-06 14:05:22 +02:00
parent 0468b6acca
commit 59bd9c132e
4 changed files with 57 additions and 36 deletions

View file

@ -712,7 +712,6 @@
(defn update-position
"Move shapes to a new position"
[id position]
(js/console.log "DEBUG" (pr-str position))
(dm/assert! (uuid? id))
(ptk/reify ::update-position

View file

@ -75,9 +75,9 @@
[_ shape objects]
(let [parent (cph/get-parent objects (:id shape))]
(when (and (ctl/flex-layout-immediate-child? objects shape)
(or (and (contains? #{:row :reverse-row} (:layout-flex-dir parent))
(or (and (contains? #{:row :row-reverse} (:layout-flex-dir parent))
(= :fill (:layout-item-h-sizing shape)))
(and (contains? #{:column :column-row} (:layout-flex-dir parent))
(and (contains? #{:column :column-reverse} (:layout-flex-dir parent))
(= :fill (:layout-item-v-sizing shape)))))
1)))
@ -90,10 +90,10 @@
(cond
(and (ctl/flex-layout-immediate-child? objects shape)
(or (and (= type :height)
(contains? #{:row :reverse-row} (:layout-flex-dir parent))
(contains? #{:row :row-reverse} (:layout-flex-dir parent))
(= :fill (:layout-item-v-sizing shape)))
(and (= type :width)
(contains? #{:column :column-row} (:layout-flex-dir parent))
(contains? #{:column :column-reverse} (:layout-flex-dir parent))
(= :fill (:layout-item-h-sizing shape)))))
:fill