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

[Merged by Bors] - The size field of CalculatedSize should not be a Size #7641

Closed

Conversation

ickshonpe
Copy link
Contributor

@ickshonpe ickshonpe commented Feb 12, 2023

Objective

The size field of CalculatedSize shouldn't be a Size as it only ever stores (unscaled) pixel values. By default its fields are Val::Auto but these are converted to 0s before being sent to Taffy.

Solution

Change the size field of CalculatedSize to a Vec2.

Changelog

  • Changed the size field of CalculatedSize to a Vec2.
  • Removed the Val <-> f32 conversion code for CalculatedSize.

Migration Guide

  • The size field of CalculatedSize has been changed to a Vec2.

@ickshonpe ickshonpe changed the title CalculatedSize's size should not be Val CalculatedSize's size should not be Size Feb 12, 2023
@ickshonpe ickshonpe changed the title CalculatedSize's size should not be Size CalculatedSize's size field should not be a Size Feb 12, 2023
@ickshonpe ickshonpe changed the title CalculatedSize's size field should not be a Size The size field of CalculatedSize's should not be a Size Feb 12, 2023
@ickshonpe ickshonpe changed the title The size field of CalculatedSize's should not be a Size The size field of CalculatedSize should not be a Size Feb 12, 2023
@alice-i-cecile alice-i-cecile added A-UI Graphical user interfaces, styles, layouts, and widgets C-Code-Quality A section of code that is hard to understand or change C-Usability A targeted quality-of-life change that makes Bevy easier to use M-Needs-Migration-Guide A breaking change to Bevy's public API that needs to be noted in a migration guide and removed C-Usability A targeted quality-of-life change that makes Bevy easier to use labels Feb 12, 2023
Copy link
Member

@alice-i-cecile alice-i-cecile left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think this needs a critical clarifying doc comment, then this LGTM.

crates/bevy_ui/src/ui_node.rs Outdated Show resolved Hide resolved
@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 Feb 12, 2023
@alice-i-cecile
Copy link
Member

bors r+

bors bot pushed a commit that referenced this pull request Feb 13, 2023
# Objective

The `size` field of `CalculatedSize` shouldn't be a `Size` as it only ever stores (unscaled) pixel values. By default its fields are `Val::Auto` but these are converted to `0`s before being sent to Taffy.

## Solution

Change the `size` field of `CalculatedSize` to a Vec2.

## Changelog

* Changed the `size` field of `CalculatedSize` to a Vec2.
* Removed the `Val` <-> `f32`  conversion code for  `CalculatedSize`.

## Migration Guide

* The size field of `CalculatedSize` has been changed to a `Vec2`.
@bors bors bot changed the title The size field of CalculatedSize should not be a Size [Merged by Bors] - The size field of CalculatedSize should not be a Size Feb 13, 2023
@bors bors bot closed this Feb 13, 2023
myreprise1 pushed a commit to myreprise1/bevy that referenced this pull request Feb 14, 2023
…ne#7641)

# Objective

The `size` field of `CalculatedSize` shouldn't be a `Size` as it only ever stores (unscaled) pixel values. By default its fields are `Val::Auto` but these are converted to `0`s before being sent to Taffy.

## Solution

Change the `size` field of `CalculatedSize` to a Vec2.

## Changelog

* Changed the `size` field of `CalculatedSize` to a Vec2.
* Removed the `Val` <-> `f32`  conversion code for  `CalculatedSize`.

## Migration Guide

* The size field of `CalculatedSize` has been changed to a `Vec2`.
myreprise1 pushed a commit to myreprise1/bevy that referenced this pull request Feb 15, 2023
…ne#7641)

# Objective

The `size` field of `CalculatedSize` shouldn't be a `Size` as it only ever stores (unscaled) pixel values. By default its fields are `Val::Auto` but these are converted to `0`s before being sent to Taffy.

## Solution

Change the `size` field of `CalculatedSize` to a Vec2.

## Changelog

* Changed the `size` field of `CalculatedSize` to a Vec2.
* Removed the `Val` <-> `f32`  conversion code for  `CalculatedSize`.

## Migration Guide

* The size field of `CalculatedSize` has been changed to a `Vec2`.
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 M-Needs-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.

3 participants