Skip to content

Commit

Permalink
fix: manually scale the damage
Browse files Browse the repository at this point in the history
  • Loading branch information
wash2 committed Dec 12, 2024
1 parent 2cfa7ff commit e255e86
Showing 1 changed file with 8 additions and 1 deletion.
9 changes: 8 additions & 1 deletion src/utils/iced.rs
Original file line number Diff line number Diff line change
Expand Up @@ -875,7 +875,7 @@ where
let background_color = state_ref.program().0.background_color(theme);
let bounds = IcedSize::new(size.w as u32, size.h as u32);
let viewport = Viewport::with_physical_size(bounds, scale.x);

let scale_x = scale.x as f32;
let current_layers = internal_ref.renderer.layers();
let mut damage: Vec<_> = old_layers
.as_ref()
Expand Down Expand Up @@ -922,8 +922,15 @@ where
&overlay,
);
}

let damage = damage
.into_iter()
.map(|d| {
cosmic::iced::Rectangle::new(
IcedPoint::new(d.x * scale_x, d.y * scale_x),
IcedSize::new(d.width * scale_x, d.height * scale_x),
)
})
.filter_map(|x| x.snap())
.map(|damage_rect| {
Rectangle::from_loc_and_size(
Expand Down

0 comments on commit e255e86

Please sign in to comment.