bevy/crates/bevy_ui/src
noxmore 73d68d60bb
Change GpuImage::size from UVec2 to Extent3d (#16815)
# Objective

When preparing `GpuImage`s, we currently discard the
`depth_or_array_layers` of the `Image`'s size by converting it into a
`UVec2`.

Fixes #16715.

## Solution

Change `GpuImage::size` to `Extent3d`, and just pass that through when
creating `GpuImage`s.
Also copy the `aspect_ratio`, and `size` (now `size_2d` for
disambiguation from the field) functions from `Image` to `GpuImage` for
ease of use with 2D textures.
I originally copied all size-related functions (like `width`, and
`height`), but i think they are unnecessary considering how visible the
`size` field on `GpuImage` is compared to `Image`.

## Testing

Tested via `cargo r -p ci` for everything except docs, when generating
docs it keeps spitting out a ton of
```
error[E0554]: `#![feature]` may not be used on the stable release channel
 --> crates/bevy_dylib/src/lib.rs:1:21
  |
1 | #![cfg_attr(docsrs, feature(doc_auto_cfg))]
  | 
```
Not sure why this is happening, but it also happens without my changes,
so it's almost certainly some strange issue specific to my machine.

## Migration Guide

- `GpuImage::size` is now an `Extent3d`. To easily get 2D size, use
`size_2d()`.
2024-12-17 19:08:09 +00:00
..
experimental Migrate UI bundles to required components (#15898) 2024-10-17 21:11:02 +00:00
layout Improve ComputedNode accessibility (#16738) 2024-12-16 23:56:32 +00:00
render Change GpuImage::size from UVec2 to Extent3d (#16815) 2024-12-17 19:08:09 +00:00
widget Move required components doc to type doc (#16575) 2024-12-03 19:45:20 +00:00
accessibility.rs Properly set accessible value on label nodes (#16418) 2024-11-17 18:10:41 +00:00
focus.rs use scale factor for touches in UI focus (#16522) 2024-11-26 21:23:12 +00:00
geometry.rs Made UIRect initialisation functions const (#16823) 2024-12-15 19:17:43 +00:00
lib.rs Remove the type parameter from check_visibility, and only invoke it once. (#16812) 2024-12-17 04:43:45 +00:00
measurement.rs Use CosmicFontSystem in public bevy_text APIs and remove cosmic_text re-export (#16063) 2024-10-23 20:05:28 +00:00
node_bundles.rs UiImage -> ImageNode, UiImageSize -> ImageNodeSize (#16271) 2024-11-07 21:52:58 +00:00
picking_backend.rs Update hashbrown to 0.15 (#15801) 2024-12-10 19:45:50 +00:00
stack.rs Update hashbrown to 0.15 (#15801) 2024-12-10 19:45:50 +00:00
ui_material.rs Move required components doc to type doc (#16575) 2024-12-03 19:45:20 +00:00
ui_node.rs Remove the type parameter from check_visibility, and only invoke it once. (#16812) 2024-12-17 04:43:45 +00:00
update.rs Update hashbrown to 0.15 (#15801) 2024-12-10 19:45:50 +00:00