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:
parent
bebe7c405d
commit
b6e4d171b5
@ -354,8 +354,8 @@ impl Default for TextFont {
|
|||||||
/// Specifies the height of each line of text for `Text` and `Text2d`
|
/// Specifies the height of each line of text for `Text` and `Text2d`
|
||||||
///
|
///
|
||||||
/// Default is 1.2x the font size
|
/// Default is 1.2x the font size
|
||||||
#[derive(Debug, Clone, Copy, Reflect)]
|
#[derive(Debug, Clone, Copy, PartialEq, Reflect)]
|
||||||
#[reflect(Debug, Clone)]
|
#[reflect(Debug, Clone, PartialEq)]
|
||||||
pub enum LineHeight {
|
pub enum LineHeight {
|
||||||
/// Set line height to a specific number of pixels
|
/// Set line height to a specific number of pixels
|
||||||
Px(f32),
|
Px(f32),
|
||||||
|
@ -2865,8 +2865,8 @@ impl ComputedNodeTarget {
|
|||||||
}
|
}
|
||||||
|
|
||||||
/// Adds a shadow behind text
|
/// Adds a shadow behind text
|
||||||
#[derive(Component, Copy, Clone, Debug, Reflect)]
|
#[derive(Component, Copy, Clone, Debug, PartialEq, Reflect)]
|
||||||
#[reflect(Component, Default, Debug, Clone)]
|
#[reflect(Component, Default, Debug, Clone, PartialEq)]
|
||||||
pub struct TextShadow {
|
pub struct TextShadow {
|
||||||
/// Shadow displacement in logical pixels
|
/// Shadow displacement in logical pixels
|
||||||
/// With a value of zero the shadow will be hidden directly behind the text
|
/// With a value of zero the shadow will be hidden directly behind the text
|
||||||
|
@ -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
|
/// 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)]
|
#[derive(Default, Debug, Clone, PartialEq, Reflect)]
|
||||||
#[reflect(Clone, Default)]
|
#[reflect(Clone, Default, PartialEq)]
|
||||||
pub enum NodeImageMode {
|
pub enum NodeImageMode {
|
||||||
/// The image will be sized automatically by taking the size of the source image and applying any layout constraints.
|
/// The image will be sized automatically by taking the size of the source image and applying any layout constraints.
|
||||||
#[default]
|
#[default]
|
||||||
|
Loading…
Reference in New Issue
Block a user