space: make render error check more readable

This commit is contained in:
Victor Brekenfeld 2022-01-04 19:06:18 +01:00
parent 26e1576f87
commit d69d15630e
1 changed files with 4 additions and 2 deletions

View File

@ -498,7 +498,7 @@ impl Space {
} }
let output_transform: Transform = output.current_transform().into(); let output_transform: Transform = output.current_transform().into();
if let Err(err) = renderer.render( let res = renderer.render(
output_transform output_transform
.transform_size(output_size) .transform_size(output_size)
.to_f64() .to_f64()
@ -559,7 +559,9 @@ impl Space {
Result::<(), R::Error>::Ok(()) Result::<(), R::Error>::Ok(())
}, },
) { );
if let Err(err) = res {
// if the rendering errors on us, we need to be prepared, that this whole buffer was partially updated and thus now unusable. // if the rendering errors on us, we need to be prepared, that this whole buffer was partially updated and thus now unusable.
// thus clean our old states before returning // thus clean our old states before returning
state.old_damage = VecDeque::new(); state.old_damage = VecDeque::new();