Skip to content

Remove the min and max fields from LayoutContext.#16459

Merged
alice-i-cecile merged 2 commits intobevyengine:mainfrom
ickshonpe:remove-min-and-max-from-LayoutContext
Dec 3, 2024
Merged

Remove the min and max fields from LayoutContext.#16459
alice-i-cecile merged 2 commits intobevyengine:mainfrom
ickshonpe:remove-min-and-max-from-LayoutContext

Conversation

@ickshonpe
Copy link
Copy Markdown
Contributor

@ickshonpe ickshonpe commented Nov 21, 2024

Objective

Remove the min and max fields from LayoutContext.
It doesn't seem useful to cache these values, it's simpler just to call min_element and max_element on the physical_size
field.

Migration Guide

The min and max fields have been removed from LayoutContext. To retrieve these values call min_element and max_element on LayoutContent::physical_size instead.

…eem to make any sense to cache these values, better to just use the `min_element` and `max_element` methods on the `physical_size` field.
@ickshonpe ickshonpe added A-UI Graphical user interfaces, styles, layouts, and widgets D-Trivial Nice and easy! A great choice to get started with Bevy labels Nov 21, 2024
@rparrett rparrett added the M-Migration-Guide A breaking change to Bevy's public API that needs to be noted in a migration guide label Nov 21, 2024
@github-actions
Copy link
Copy Markdown
Contributor

It looks like your PR is a breaking change, but you didn't provide a migration guide.

Could you add some context on what users should update when this change get released in a new version of Bevy?
It will be used to help writing the migration guide for the version. Putting it after a ## Migration Guide will help it get automatically picked up by our tooling.

@ickshonpe ickshonpe added the C-Code-Quality A section of code that is hard to understand or change label Nov 21, 2024
@alice-i-cecile alice-i-cecile added this to the 0.16 milestone Nov 22, 2024
@alice-i-cecile alice-i-cecile added the S-Ready-For-Final-Review This PR has been approved by the community. It's ready for a maintainer to consider merging it label Nov 22, 2024
Merged via the queue into bevyengine:main with commit 343a52a Dec 3, 2024
ecoskey pushed a commit to ecoskey/bevy that referenced this pull request Jan 6, 2025
…6459)

# Objective

Remove the `min` and `max` fields from `LayoutContext`. 
It doesn't seem useful to cache these values, it's simpler just to call
`min_element` and `max_element` on the `physical_size`
field.

##  Migration Guide

The `min` and `max` fields have been removed from `LayoutContext`. To
retrieve these values call `min_element` and `max_element` on
`LayoutContent::physical_size` instead.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

A-UI Graphical user interfaces, styles, layouts, and widgets C-Code-Quality A section of code that is hard to understand or change D-Trivial Nice and easy! A great choice to get started with Bevy M-Migration-Guide A breaking change to Bevy's public API that needs to be noted in a migration guide S-Ready-For-Final-Review This PR has been approved by the community. It's ready for a maintainer to consider merging it

Projects

None yet

Development

Successfully merging this pull request may close these issues.

5 participants