mirror of
https://github.com/penpot/penpot.git
synced 2025-01-24 23:49:45 -05:00
✨ Change defaults for new grid tracks
This commit is contained in:
parent
07ce435a91
commit
7508627dc5
3 changed files with 7 additions and 6 deletions
|
@ -113,8 +113,8 @@
|
|||
|
||||
([_objects shapes parent]
|
||||
(if (empty? shapes)
|
||||
(-> {:layout-grid-columns [{:type :auto} {:type :auto}]
|
||||
:layout-grid-rows [{:type :auto} {:type :auto}]}
|
||||
(-> {:layout-grid-columns [ctl/default-track-value ctl/default-track-value]
|
||||
:layout-grid-rows [ctl/default-track-value ctl/default-track-value]}
|
||||
(ctl/create-cells [1 1 2 2]))
|
||||
|
||||
(let [all-shapes-rect (gco/shapes->rect shapes)
|
||||
|
@ -149,8 +149,8 @@
|
|||
0
|
||||
(/ (- (:height all-shapes-rect) total-rows-height) (dec num-rows)))
|
||||
|
||||
layout-grid-rows (mapv (constantly (array-map :type :auto)) rows)
|
||||
layout-grid-columns (mapv (constantly (array-map :type :auto)) cols)
|
||||
layout-grid-rows (mapv (constantly ctl/default-track-value) rows)
|
||||
layout-grid-columns (mapv (constantly ctl/default-track-value) cols)
|
||||
|
||||
parent-childs-vector (gpt/to-vec (gpo/origin (:points parent)) (gpt/point all-shapes-rect))
|
||||
p-left (:x parent-childs-vector)
|
||||
|
|
|
@ -590,7 +590,8 @@
|
|||
(declare assign-cells)
|
||||
|
||||
(def default-track-value
|
||||
{:type :auto})
|
||||
{:type :flex
|
||||
:value 1})
|
||||
|
||||
(def grid-cell-defaults
|
||||
{:row-span 1
|
||||
|
|
|
@ -966,7 +966,7 @@
|
|||
(mf/use-fn
|
||||
(mf/deps type reorder-track index)
|
||||
(fn [drop-position data event]
|
||||
(reorder-track type (:index data) (if (= :top drop-position) (dec index) index) (kbd/mod? event))))
|
||||
(reorder-track type (:index data) (if (= :top drop-position) (dec index) index) (not (kbd/mod? event)))))
|
||||
|
||||
pointer-enter
|
||||
(mf/use-fn
|
||||
|
|
Loading…
Add table
Reference in a new issue