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 authored and Drakulix committed Dec 12, 2024
1 parent 3132767 commit 5b89ad2
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 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,10 @@ where
&overlay,
);
}

let damage = damage
.into_iter()
.map(|d| d * scale_x)
.filter_map(|x| x.snap())
.map(|damage_rect| {
Rectangle::from_loc_and_size(
Expand Down

0 comments on commit 5b89ad2

Please sign in to comment.