Adding PartialEq to some UI and Text types (#19552)

# Objective

- During the development of
[`bevy_flair`](https://github.com/eckz/bevy_flair) I found [some types
lacking
`PartialEq`](https://github.com/search?q=repo%3Aeckz%2Fbevy_flair%20%20%22Try%20to%20upstream%20it%20to%20bevy%22&type=code)
which made the unit testing a little bit inconvinient.

## Solution

- Adding `PartialEq` for the following types:
  - `LineHeight `
  - `TextShadow`
  - `NodeImageMode`

## Testing

- Letting github actions do the testing, this is not an invasive change
and `cargo run --bin ci` doesn't seem to work in `main` at the moment.
This commit is contained in:
Erick Z 2025-06-09 22:08:17 +02:00 committed by GitHub
parent bebe7c405d
commit b6e4d171b5
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
3 changed files with 6 additions and 6 deletions

View File

@ -354,8 +354,8 @@ impl Default for TextFont {
/// Specifies the height of each line of text for `Text` and `Text2d`
///
/// Default is 1.2x the font size
#[derive(Debug, Clone, Copy, Reflect)]
#[reflect(Debug, Clone)]
#[derive(Debug, Clone, Copy, PartialEq, Reflect)]
#[reflect(Debug, Clone, PartialEq)]
pub enum LineHeight {
/// Set line height to a specific number of pixels
Px(f32),

View File

@ -2865,8 +2865,8 @@ impl ComputedNodeTarget {
}
/// Adds a shadow behind text
#[derive(Component, Copy, Clone, Debug, Reflect)]
#[reflect(Component, Default, Debug, Clone)]
#[derive(Component, Copy, Clone, Debug, PartialEq, Reflect)]
#[reflect(Component, Default, Debug, Clone, PartialEq)]
pub struct TextShadow {
/// Shadow displacement in logical pixels
/// With a value of zero the shadow will be hidden directly behind the text

View File

@ -138,8 +138,8 @@ impl From<Handle<Image>> for ImageNode {
}
/// Controls how the image is altered to fit within the layout and how the layout algorithm determines the space in the layout for the image
#[derive(Default, Debug, Clone, Reflect)]
#[reflect(Clone, Default)]
#[derive(Default, Debug, Clone, PartialEq, Reflect)]
#[reflect(Clone, Default, PartialEq)]
pub enum NodeImageMode {
/// The image will be sized automatically by taking the size of the source image and applying any layout constraints.
#[default]