Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fixes for aspect ratio and min/max sizes #317

Merged
merged 40 commits into from Jan 12, 2023
Merged
Show file tree
Hide file tree
Changes from 35 commits
Commits
Show all changes
40 commits
Select commit Hold shift + click to select a range
0bff4e2
Add aspect ratio support to gentest script + add aspect ratio support…
nicoburns Jan 4, 2023
2801c19
Add maybe_apply_aspect_ratio helper to Size<Option<f32>>
nicoburns Jan 4, 2023
1dea4d0
Apply aspect ratio to leaf node style resolution
nicoburns Jan 4, 2023
fd88cf4
Apply aspect ratio when doing final placement of grid items
nicoburns Jan 4, 2023
da30c98
Make cargo gentest compile generator in release mode
nicoburns Jan 4, 2023
cd7a563
Add tests for aspect ratio of leaf nodes in grid containers
nicoburns Jan 4, 2023
d74c903
Apply aspect ratio to grid container styles
nicoburns Jan 4, 2023
796cf13
Apply aspect ratio to automatic minimum size
nicoburns Jan 4, 2023
fd57d84
Add tests for aspect ratio of content-sized leaf nodes
nicoburns Jan 4, 2023
fbc92dc
Use main size for flex-basis if flex-basis is not set
nicoburns Jan 4, 2023
807624e
Resolve size, min_size, max_size against aspect ratio when generating…
nicoburns Jan 4, 2023
b2f0905
Add gentests for aspect-ratio in flex-row (align-start)
nicoburns Jan 4, 2023
8efe05c
Move aspect ratio handling from text measure func to leaf.rs
nicoburns Jan 4, 2023
81ac768
Tweak clamping of flex item minimum sizes
nicoburns Jan 4, 2023
214b4e6
Add aspect ratio tests for flex-columns with align-items: start
nicoburns Jan 4, 2023
e2af292
FLexbox: don't apply aspect ratio to max_width when clamping stretche…
nicoburns Jan 4, 2023
03c9167
Add tests for aspect ratio with align-items:stretch (flexbox)
nicoburns Jan 4, 2023
a3895d5
Apply aspect ratio to absolute children of flex container
nicoburns Jan 5, 2023
63f12a2
Remove duplicate test
nicoburns Jan 5, 2023
9a81357
Namespace grid aspect ratio tests under grid
nicoburns Jan 5, 2023
1dcf6db
Absolute positioning: Apply aspect ratio to inset-generated width bef…
nicoburns Jan 7, 2023
8b92331
Add tests for aspect ratio height/width for absolutely positioned nodes
nicoburns Jan 7, 2023
5c66c23
Exclude hidden items from absolute positioning
nicoburns Jan 7, 2023
b147f78
Apply min/max sizes when finally positioning grid items
nicoburns Jan 7, 2023
c20a307
Add tests for interaction between inset and aspect ratio for absolute…
nicoburns Jan 8, 2023
a2ef38c
Always apply margins to absolutely positioned grid items
nicoburns Jan 8, 2023
befdef1
Rewrite flex item absolute positioning
nicoburns Jan 8, 2023
e9568cf
Take border into account when absolutely positioning grid items relat…
nicoburns Jan 8, 2023
fad8919
Add absolute positioning margin test
nicoburns Jan 8, 2023
f063cc0
Apply suggestions from code review
nicoburns Jan 8, 2023
01fadec
Update release notes
nicoburns Jan 8, 2023
29161f0
Add test for absolutely positioned fallback to static position of gri…
nicoburns Jan 8, 2023
db1bc72
Implement Add for Rect where the inner type implements Add
nicoburns Jan 8, 2023
dec6bc0
Apply aspect ratio and min/max size to flex container size
nicoburns Jan 8, 2023
0319a30
Cleanup TODOs in the flexbox algorithm
nicoburns Jan 8, 2023
e1ef9d8
Remove one more TODO
nicoburns Jan 8, 2023
1419e31
Add min/max size tests for absolutely positioned flex items
nicoburns Jan 11, 2023
94df9c5
Move absolute flex positioning aspect ratio tests under absolute name…
nicoburns Jan 11, 2023
1ded18f
Clamp available_space by min/max size for final layout
nicoburns Jan 11, 2023
355477e
Add tests for applying aspect ratio to min/max size of flex items
nicoburns Jan 11, 2023
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
2 changes: 1 addition & 1 deletion .cargo/config.toml
@@ -1,2 +1,2 @@
[alias]
gentest = "run --package gentest --"
gentest = "run --release --package gentest --"
3 changes: 3 additions & 0 deletions RELEASES.md
Expand Up @@ -13,6 +13,9 @@
### Fixes

- Flexbox nodes sized under a min-content constraint now size correctly (#291)
- Aspect ratio is now applied correctly in many circumstances
- Absolutely positioned items now apply margins correctly
- Min/max size are now applied correctly

### Removed

Expand Down
36 changes: 36 additions & 0 deletions benches/generated/absolute_margin_bottom_left.rs

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

33 changes: 33 additions & 0 deletions benches/generated/aspect_ratio_flex_absolute_fill_height.rs

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

33 changes: 33 additions & 0 deletions benches/generated/aspect_ratio_flex_absolute_fill_width.rs

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

28 changes: 28 additions & 0 deletions benches/generated/aspect_ratio_flex_column_fill_height.rs

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

22 changes: 22 additions & 0 deletions benches/generated/aspect_ratio_flex_column_fill_max_height.rs

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

40 changes: 40 additions & 0 deletions benches/generated/aspect_ratio_flex_column_fill_max_width.rs

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.