mirror of
https://github.com/bevyengine/bevy
synced 2024-11-10 07:04:33 +00:00
a7be8a2655
# Objective
The physical width and height (pixels) of an image is always integers,
but for `GpuImage` bevy currently stores them as `Vec2` (`f32`).
Switching to `UVec2` makes this more consistent with the [underlying
texture data](https://docs.rs/wgpu/latest/wgpu/struct.Extent3d.html).
I'm not sure if this is worth the change in the surface level API. If
not, feel free to close this PR.
## Solution
- Replace uses of `Vec2` with `UVec2` when referring to texture
dimensions.
- Use integer types for the texture atlas dimensions and sections.
[`Sprite::rect`](
|
||
---|---|---|
.. | ||
borders.rs | ||
button.rs | ||
display_and_visibility.rs | ||
flex_layout.rs | ||
font_atlas_debug.rs | ||
grid.rs | ||
overflow.rs | ||
overflow_debug.rs | ||
relative_cursor_position.rs | ||
render_ui_to_texture.rs | ||
size_constraints.rs | ||
text.rs | ||
text_debug.rs | ||
text_wrap_debug.rs | ||
transparency_ui.rs | ||
ui.rs | ||
ui_material.rs | ||
ui_scaling.rs | ||
ui_texture_atlas.rs | ||
ui_texture_slice.rs | ||
viewport_debug.rs | ||
window_fallthrough.rs | ||
z_index.rs |