From e008437f5947fcf14985910dc0ac7910de94dd62 Mon Sep 17 00:00:00 2001 From: Victoria Brekenfeld Date: Tue, 5 Mar 2024 13:54:41 +0100 Subject: [PATCH] tiling: Fix rendering of too small tiles --- src/shell/layout/tiling/mod.rs | 18 ++++++++++++------ 1 file changed, 12 insertions(+), 6 deletions(-) diff --git a/src/shell/layout/tiling/mod.rs b/src/shell/layout/tiling/mod.rs index 2aa32c89..db236fcc 100644 --- a/src/shell/layout/tiling/mod.rs +++ b/src/shell/layout/tiling/mod.rs @@ -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 { CosmicMappedRenderElement::Stack(elem) => constrain_render_elements( std::iter::once(elem), @@ -5264,8 +5270,8 @@ where - elem_geometry.loc, geo.as_logical().to_physical_precise_round(output_scale), elem_geometry, - ConstrainScaleBehavior::Stretch, - ConstrainAlign::CENTER, + behavior, + ConstrainAlign::TOP_LEFT, output_scale, ) .next() @@ -5276,8 +5282,8 @@ where - elem_geometry.loc, geo.as_logical().to_physical_precise_round(output_scale), elem_geometry, - ConstrainScaleBehavior::Stretch, - ConstrainAlign::CENTER, + behavior, + ConstrainAlign::TOP_LEFT, output_scale, ) .next() @@ -5288,8 +5294,8 @@ where - elem_geometry.loc, geo.as_logical().to_physical_precise_round(output_scale), elem_geometry, - ConstrainScaleBehavior::Stretch, - ConstrainAlign::CENTER, + behavior, + ConstrainAlign::TOP_LEFT, output_scale, ) .next()