bevy/examples/ui
Félix Lescaudey de Maneville e0c296ee14
Optional ImageScaleMode (#11780)
> Follow up to #11600 and #10588 

@mockersf expressed some [valid
concerns](https://github.com/bevyengine/bevy/pull/11600#issuecomment-1932796498)
about the current system this PR attempts to fix:

The `ComputedTextureSlices` reacts to asset change in both `bevy_sprite`
and `bevy_ui`, meaning that if the `ImageScaleMode` is inserted by
default in the bundles, we will iterate through most 2d items every time
an asset is updated.

# Solution

- `ImageScaleMode` only has two variants: `Sliced` and `Tiled`. I
removed the `Stretched` default
- `ImageScaleMode` is no longer part of any bundle, but the relevant
bundles explain that this additional component can be inserted

This way, the *absence* of `ImageScaleMode` means the image will be
stretched, and its *presence* will include the entity to the various
slicing systems

Optional components in bundles would make this more straigthfoward

# Additional work

Should I add new bundles with the `ImageScaleMode` component ?
2024-02-09 20:36:32 +00:00
..
borders.rs UI node outlines (#9931) 2023-10-05 12:10:32 +00:00
button.rs Add [lints] table, fix adding #![allow(clippy::type_complexity)] everywhere (#10011) 2023-11-18 20:58:48 +00:00
display_and_visibility.rs Rename TextAlignment to JustifyText. (#10854) 2023-12-05 03:00:41 +00:00
flex_layout.rs UI examples clean up (#9479) 2023-08-23 12:49:10 +00:00
font_atlas_debug.rs Texture Atlas rework (#5103) 2024-01-16 13:59:08 +00:00
grid.rs Update default ClearColor to better match Bevy's branding (#10339) 2023-11-03 12:57:38 +00:00
overflow.rs Make clipped areas of UI nodes non-interactive (#10454) 2023-11-22 14:30:38 +00:00
overflow_debug.rs Update winit dependency to 0.29 (#10702) 2023-12-21 07:40:47 +00:00
relative_cursor_position.rs Camera-driven UI (#10559) 2024-01-16 00:39:10 +00:00
render_ui_to_texture.rs Deprecate shapes in bevy_render::mesh::shape (#11773) 2024-02-08 18:01:34 +00:00
size_constraints.rs Deprecated Various Component Methods from Query and QueryState (#9920) 2024-02-04 01:01:59 +00:00
text.rs Replace DiagnosticId by DiagnosticPath (#9266) 2024-01-20 15:42:51 +00:00
text_debug.rs Replace DiagnosticId by DiagnosticPath (#9266) 2024-01-20 15:42:51 +00:00
text_wrap_debug.rs Fix panic in examples using argh on the web (#11513) 2024-01-24 21:16:10 +00:00
transparency_ui.rs Have a separate implicit viewport node per root node + make viewport node Display::Grid (#9637) 2023-09-19 15:14:46 +00:00
ui.rs Update default ClearColor to better match Bevy's branding (#10339) 2023-11-03 12:57:38 +00:00
ui_material.rs Explicit color conversion methods (#10321) 2023-11-15 16:47:32 +00:00
ui_scaling.rs Update glam, encase and hexasphere (#11082) 2024-01-08 22:58:45 +00:00
ui_texture_atlas.rs Texture Atlas rework (#5103) 2024-01-16 13:59:08 +00:00
ui_texture_slice.rs Optional ImageScaleMode (#11780) 2024-02-09 20:36:32 +00:00
viewport_debug.rs Use default resolution for viewport_debug example (#9666) 2023-09-02 18:43:56 +00:00
window_fallthrough.rs Update winit dependency to 0.29 (#10702) 2023-12-21 07:40:47 +00:00
z_index.rs Have a separate implicit viewport node per root node + make viewport node Display::Grid (#9637) 2023-09-19 15:14:46 +00:00