mirror of
https://github.com/gfx-rs/wgpu.git
synced 2024-11-25 16:24:24 +00:00
Ignore the exception values generated by the winit resize event (#3916)
This commit is contained in:
parent
fd5550cc89
commit
d089b9488b
@ -106,6 +106,7 @@ Bottom level categories:
|
|||||||
#### General
|
#### General
|
||||||
|
|
||||||
- Publish examples to wgpu.rs on updates to trunk branch instead of gecko. By @paul-hansen in [#3750](https://github.com/gfx-rs/wgpu/pull/3750)
|
- Publish examples to wgpu.rs on updates to trunk branch instead of gecko. By @paul-hansen in [#3750](https://github.com/gfx-rs/wgpu/pull/3750)
|
||||||
|
- Ignore the exception values generated by the winit resize event. By @jinleili in [#3916](https://github.com/gfx-rs/wgpu/pull/3916)
|
||||||
|
|
||||||
## v0.16.2 (2023-07-09)
|
## v0.16.2 (2023-07-09)
|
||||||
|
|
||||||
|
@ -307,11 +307,22 @@ fn start<E: Example>(
|
|||||||
},
|
},
|
||||||
..
|
..
|
||||||
} => {
|
} => {
|
||||||
log::info!("Resizing to {:?}", size);
|
// Once winit is fixed, the detection conditions here can be removed.
|
||||||
config.width = size.width.max(1);
|
// https://github.com/rust-windowing/winit/issues/2876
|
||||||
config.height = size.height.max(1);
|
let max_dimension = adapter.limits().max_texture_dimension_2d;
|
||||||
example.resize(&config, &device, &queue);
|
if size.width > max_dimension || size.height > max_dimension {
|
||||||
surface.configure(&device, &config);
|
log::warn!(
|
||||||
|
"The resizing size {:?} exceeds the limit of {}.",
|
||||||
|
size,
|
||||||
|
max_dimension
|
||||||
|
);
|
||||||
|
} else {
|
||||||
|
log::info!("Resizing to {:?}", size);
|
||||||
|
config.width = size.width.max(1);
|
||||||
|
config.height = size.height.max(1);
|
||||||
|
example.resize(&config, &device, &queue);
|
||||||
|
surface.configure(&device, &config);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
event::Event::WindowEvent { event, .. } => match event {
|
event::Event::WindowEvent { event, .. } => match event {
|
||||||
WindowEvent::KeyboardInput {
|
WindowEvent::KeyboardInput {
|
||||||
|
Loading…
Reference in New Issue
Block a user