bevy/crates/bevy_text/src
Gino Valente bd008589f3 bevy_reflect: Update enum derives (#5473)
> In draft until #4761 is merged. See the relevant commits [here](a85fe94a18).

---

# Objective

Update enums across Bevy to use the new enum reflection and get rid of `#[reflect_value(...)]` usages.

## Solution

Find and replace all[^1] instances of `#[reflect_value(...)]` on enum types.

---

## Changelog

- Updated all[^1] reflected enums to implement `Enum` (i.e. they are no longer `ReflectRef::Value`)

## Migration Guide
Bevy-defined enums have been updated to implement `Enum` and are not considered value types (`ReflectRef::Value`) anymore. This means that their serialized representations will need to be updated. For example, given the Bevy enum:

```rust
pub enum ScalingMode {
  None,
  WindowSize,
  Auto { min_width: f32, min_height: f32 },
  FixedVertical(f32),
  FixedHorizontal(f32),
}
```

You will need to update the serialized versions accordingly.

```js
// OLD FORMAT
{
  "type": "bevy_render:📷:projection::ScalingMode",
  "value": FixedHorizontal(720),
},

// NEW FORMAT
{
  "type": "bevy_render:📷:projection::ScalingMode",
  "enum": {
    "variant": "FixedHorizontal",
    "tuple": [
      {
        "type": "f32",
        "value": 720,
      },
    ],
  },
},
```

This may also have other smaller implications (such as `Debug` representation), but serialization is probably the most prominent.

[^1]: All enums except `HandleId` as neither `Uuid` nor `AssetPathId` implement the reflection traits
2022-08-02 22:40:29 +00:00
..
error.rs Fix errors and panics to typical Rust conventions (#968) 2020-12-02 11:31:16 -08:00
font_atlas_set.rs Updated glam to 0.21. (#5142) 2022-07-03 19:55:33 +00:00
font_atlas.rs Replace old renderer with new renderer (#3312) 2021-12-14 03:58:23 +00:00
font_loader.rs Add support for OTF fonts (#1200) 2021-01-03 12:10:23 -08:00
font.rs small and mostly pointless refactoring (#2934) 2022-02-13 22:33:55 +00:00
glyph_brush.rs Move Size to bevy_ui (#4285) 2022-04-25 13:54:46 +00:00
lib.rs Update layout/style when scale factor changes too (#4689) 2022-05-09 14:18:02 +00:00
pipeline.rs Updated glam to 0.21. (#5142) 2022-07-03 19:55:33 +00:00
text2d.rs text rendering: convert colours only once per section (#5474) 2022-07-28 13:34:56 +00:00
text.rs bevy_reflect: Update enum derives (#5473) 2022-08-02 22:40:29 +00:00