tiling: Fix rendering of too small tiles

This commit is contained in:
Victoria Brekenfeld 2024-03-05 13:54:41 +01:00
parent 4695da04f9
commit e008437f59

View file

@ -5257,6 +5257,12 @@ where
) )
} }
let behavior = if animating {
ConstrainScaleBehavior::Stretch
} else {
ConstrainScaleBehavior::CutOff
};
let w_elements = w_elements.into_iter().flat_map(|element| match element { let w_elements = w_elements.into_iter().flat_map(|element| match element {
CosmicMappedRenderElement::Stack(elem) => constrain_render_elements( CosmicMappedRenderElement::Stack(elem) => constrain_render_elements(
std::iter::once(elem), std::iter::once(elem),
@ -5264,8 +5270,8 @@ where
- elem_geometry.loc, - elem_geometry.loc,
geo.as_logical().to_physical_precise_round(output_scale), geo.as_logical().to_physical_precise_round(output_scale),
elem_geometry, elem_geometry,
ConstrainScaleBehavior::Stretch, behavior,
ConstrainAlign::CENTER, ConstrainAlign::TOP_LEFT,
output_scale, output_scale,
) )
.next() .next()
@ -5276,8 +5282,8 @@ where
- elem_geometry.loc, - elem_geometry.loc,
geo.as_logical().to_physical_precise_round(output_scale), geo.as_logical().to_physical_precise_round(output_scale),
elem_geometry, elem_geometry,
ConstrainScaleBehavior::Stretch, behavior,
ConstrainAlign::CENTER, ConstrainAlign::TOP_LEFT,
output_scale, output_scale,
) )
.next() .next()
@ -5288,8 +5294,8 @@ where
- elem_geometry.loc, - elem_geometry.loc,
geo.as_logical().to_physical_precise_round(output_scale), geo.as_logical().to_physical_precise_round(output_scale),
elem_geometry, elem_geometry,
ConstrainScaleBehavior::Stretch, behavior,
ConstrainAlign::CENTER, ConstrainAlign::TOP_LEFT,
output_scale, output_scale,
) )
.next() .next()