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

Grid: only stretch auto tracks if content-alignment is stretch #783

Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 4 additions & 0 deletions src/compute/grid/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -247,6 +247,7 @@ pub fn compute_grid_layout<Tree: LayoutGridContainer>(
AbstractAxis::Inline,
min_size.get(AbstractAxis::Inline),
max_size.get(AbstractAxis::Inline),
justify_content,
align_content,
available_grid_space,
inner_node_size,
Expand All @@ -269,6 +270,7 @@ pub fn compute_grid_layout<Tree: LayoutGridContainer>(
AbstractAxis::Block,
min_size.get(AbstractAxis::Block),
max_size.get(AbstractAxis::Block),
align_content,
justify_content,
available_grid_space,
inner_node_size,
Expand Down Expand Up @@ -385,6 +387,7 @@ pub fn compute_grid_layout<Tree: LayoutGridContainer>(
AbstractAxis::Inline,
min_size.get(AbstractAxis::Inline),
max_size.get(AbstractAxis::Inline),
justify_content,
align_content,
available_grid_space,
inner_node_size,
Expand Down Expand Up @@ -444,6 +447,7 @@ pub fn compute_grid_layout<Tree: LayoutGridContainer>(
AbstractAxis::Block,
min_size.get(AbstractAxis::Block),
max_size.get(AbstractAxis::Block),
align_content,
justify_content,
available_grid_space,
inner_node_size,
Expand Down
5 changes: 4 additions & 1 deletion src/compute/grid/track_sizing.rs
Original file line number Diff line number Diff line change
Expand Up @@ -271,6 +271,7 @@ pub(super) fn track_sizing_algorithm<Tree: LayoutPartialTree>(
axis: AbstractAxis,
axis_min_size: Option<f32>,
axis_max_size: Option<f32>,
axis_alignment: AlignContent,
other_axis_alignment: AlignContent,
available_grid_space: Size<AvailableSpace>,
inner_node_size: Size<Option<f32>>,
Expand Down Expand Up @@ -357,7 +358,9 @@ pub(super) fn track_sizing_algorithm<Tree: LayoutPartialTree>(

// 11.8. Stretch auto Tracks
// This step expands tracks that have an auto max track sizing function by dividing any remaining positive, definite free space equally amongst them.
stretch_auto_tracks(axis_tracks, axis_min_size, axis_available_space_for_expansion);
if axis_alignment == AlignContent::Stretch {
stretch_auto_tracks(axis_tracks, axis_min_size, axis_available_space_for_expansion);
}
}

/// Whether it is a minimum or maximum size's space being distributed
Expand Down
Loading