Skip to content

refactor: change fair/fairv to use a 2 level tree#938

Open
DuckTapeMan35 wants to merge 1 commit into
mangowm:mainfrom
DuckTapeMan35:main
Open

refactor: change fair/fairv to use a 2 level tree#938
DuckTapeMan35 wants to merge 1 commit into
mangowm:mainfrom
DuckTapeMan35:main

Conversation

@DuckTapeMan35
Copy link
Copy Markdown

the idea is that we can step once through the tree to get the layout (dfs) and since this makes it declarative resize can simply mutate the tree and the arranger will handle the rest.

the tree looks a bit like:

FairState (root)
├── cols[0] { ratio: col_width_weight }
│ ├── row_ratios[0] row_height_weight
│ ├── row_ratios[1] row_height_weight
│ └── row_ratios[2] row_height_weight
├── cols[1] { ratio: col_width_weight }
│ ├── row_ratios[0] row_height_weight
│ └── row_ratios[1] row_height_weight
└── cols[2] { ratio: col_width_weight }
└── row_ratios[0] row_height_weight

the idea is that we can step once through the tree to get the layout
(dfs) and since this makes it declarative resize can simply mutate the
tree and the arranger will handle the rest.

the tree looks a bit like:

FairState (root)
├── cols[0]  { ratio: col_width_weight }
│   ├── row_ratios[0]  row_height_weight
│   ├── row_ratios[1]  row_height_weight
│   └── row_ratios[2]  row_height_weight
├── cols[1]  { ratio: col_width_weight }
│   ├── row_ratios[0]  row_height_weight
│   └── row_ratios[1]  row_height_weight
└── cols[2]  { ratio: col_width_weight }
    └── row_ratios[0]  row_height_weight
@DreamMaoMao DreamMaoMao force-pushed the main branch 3 times, most recently from c009ba2 to f328c27 Compare May 20, 2026 05:07
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant