Nest age declaration inside last_primitives

This commit is contained in:
Héctor Ramón Jiménez 2024-01-18 10:43:52 +01:00
parent b6b3e9b9f9
commit 150ce65e20
No known key found for this signature in database
GPG key ID: 7CC46565708259A7

View file

@ -165,9 +165,9 @@ pub fn present<T: AsRef<str>>(
.buffer_mut()
.map_err(|_| compositor::SurfaceError::Lost)?;
let age = buffer.age();
let last_primitives = {
let age = buffer.age();
surface.max_age = surface.max_age.max(age);
surface.primitive_stack.truncate(surface.max_age as usize);