Skip to content

Commit

Permalink
fix: apply transform to damage before blitting
Browse files Browse the repository at this point in the history
  • Loading branch information
wash2 authored and Drakulix committed Nov 13, 2024
1 parent 91bc1c0 commit 8d5541b
Showing 1 changed file with 11 additions and 1 deletion.
12 changes: 11 additions & 1 deletion src/backend/kms/surface/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -1205,13 +1205,23 @@ impl SurfaceThreadState {
.into_iter()
.flatten();

// If the screen is rotated, we must convert damage to match output.
let adjusted = damage.iter().copied().map(|mut d| {
d.size = d
.size
.to_logical(1)
.to_buffer(1, output_transform)
.to_logical(1, Transform::Normal)
.to_physical(1);
d
});
match frame_result
.blit_frame_result(
output_size,
output_transform,
output_scale,
&mut renderer,
damage.iter().copied(),
adjusted,
filter,
)
.map_err(|err| match err {
Expand Down

0 comments on commit 8d5541b

Please sign in to comment.