renderer: fixup damage calculations for smaller buffer sizes

This commit is contained in:
Victor Brekenfeld 2022-01-04 18:05:43 +01:00
parent 5b6700c151
commit 61b19e4198
1 changed files with 7 additions and 2 deletions

View File

@ -88,7 +88,7 @@ where
let mut result = Ok(()); let mut result = Ok(());
let damage = damage let damage = damage
.iter() .iter()
.map(|geo| geo.to_f64().to_physical(scale).to_i32_round()) .map(|geo| geo.to_f64().to_physical(scale).to_i32_up())
.collect::<Vec<_>>(); .collect::<Vec<_>>();
with_surface_tree_upward( with_surface_tree_upward(
surface, surface,
@ -160,7 +160,12 @@ where
let rect = Rectangle::<i32, Physical>::from_loc_and_size( let rect = Rectangle::<i32, Physical>::from_loc_and_size(
surface_offset.to_f64().to_physical(scale).to_i32_round(), surface_offset.to_f64().to_physical(scale).to_i32_round(),
buffer_dimensions.unwrap(), buffer_dimensions
.unwrap_or_default()
.to_logical(buffer_scale)
.to_f64()
.to_physical(scale)
.to_i32_round(),
); );
let new_damage = damage let new_damage = damage
.iter() .iter()