From e669396fd54415d91bcd482dd2f6f763dd6ba7b6 Mon Sep 17 00:00:00 2001 From: Victoria Brekenfeld Date: Thu, 29 Feb 2024 17:44:51 +0100 Subject: [PATCH] tiling: Fix broken minimize animation --- src/shell/layout/tiling/mod.rs | 14 ++++---------- 1 file changed, 4 insertions(+), 10 deletions(-) diff --git a/src/shell/layout/tiling/mod.rs b/src/shell/layout/tiling/mod.rs index cbe581af..3f53258d 100644 --- a/src/shell/layout/tiling/mod.rs +++ b/src/shell/layout/tiling/mod.rs @@ -4707,7 +4707,7 @@ where if let Some(minimize_geo) = minimize_geo { scaled_geo = Some( ease( - EaseInOutCubic, + Linear, EaseRectangle(*original_geo), EaseRectangle(*minimize_geo), percentage, @@ -4715,6 +4715,7 @@ where .unwrap(), ); } + let (scale, offset) = scaled_geo .map(|adapted_geo| scale_to_center(&original_geo, &adapted_geo)) .unwrap_or_else(|| (1.0.into(), (0, 0).into())); @@ -4730,20 +4731,13 @@ where }) .unwrap_or(*original_geo); - let original_location = original_geo - .loc - .as_logical() - .to_physical_precise_round(output_scale) - - mapped - .geometry() - .loc - .to_physical_precise_round(output_scale); let elem_geometry = mapped.geometry().to_physical_precise_round(output_scale); let (w_elements, p_elements) = mapped .split_render_elements::>( renderer, - original_location, + geo.loc.as_logical().to_physical_precise_round(output_scale) + - elem_geometry.loc, Scale::from(output_scale), 1.0 - percentage, );