Make Viewport::default() return a 1x1 viewport (#14372)

# Objective

- The current default viewport crashes bevy due to a wgpu validation
error, this PR fixes that
- Fixes https://github.com/bevyengine/bevy/issues/14355

## Solution

- `Viewport::default()` now returns a 1x1 viewport

## Testing

- I modified the `3d_viewport_to_world` example to use
`Viewport::default()`, and it works as expected (only the top-left pixel
is rendered)
This commit is contained in:
Sludge 2024-07-20 16:18:12 +02:00 committed by GitHub
parent 9da18cce2a
commit c0cebfef45
No known key found for this signature in database
GPG key ID: B5690EEEBB952194

View file

@ -61,7 +61,7 @@ impl Default for Viewport {
fn default() -> Self {
Self {
physical_position: Default::default(),
physical_size: Default::default(),
physical_size: UVec2::new(1, 1),
depth: 0.0..1.0,
}
}