layout/tiling: Resize shadows to fit scaled windows

This commit is contained in:
Victoria Brekenfeld 2025-12-16 18:48:40 +01:00 committed by Victoria Brekenfeld
parent 23e1bae96e
commit 6d0f1b273f
6 changed files with 57 additions and 44 deletions

View file

@ -358,7 +358,8 @@ impl CosmicWindow {
&self,
renderer: &mut R,
location: Point<i32, Physical>,
scale: Scale<f64>,
output_scale: Scale<f64>,
scale: f64,
alpha: f32,
) -> Option<C>
where
@ -394,7 +395,7 @@ impl CosmicWindow {
.cosmic()
.radius_s()
.map(|x| if x < 4.0 { x } else { x + 4.0 })
.map(|x| x.round() as u8);
.map(|x| (x * scale as f32).round() as u8);
if has_ssd && !clip {
// bottom corners
radii[0] = 0;
@ -407,10 +408,11 @@ impl CosmicWindow {
}
let mut geo = SpaceElement::geometry(&p.window).to_f64();
geo.loc += location.to_f64().to_logical(scale);
if has_ssd {
geo.size.h += SSD_HEIGHT as f64;
}
geo = geo.upscale(scale);
geo.loc += location.to_f64().to_logical(output_scale);
let window_key =
CosmicMappedKey(CosmicMappedKeyInner::Window(Arc::downgrade(&self.0.0)));
@ -422,7 +424,7 @@ impl CosmicWindow {
geo.to_i32_round().as_local(),
radii,
if activated { alpha } else { alpha * 0.75 },
scale.x,
output_scale.x,
))
.into(),
)