Skip to content

Commit

Permalink
Fix indexing issue (#27)
Browse files Browse the repository at this point in the history
  • Loading branch information
fintelia authored Dec 25, 2023
1 parent 681c84d commit b93b4e6
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions src/extended.rs
Original file line number Diff line number Diff line change
Expand Up @@ -87,10 +87,10 @@ pub(crate) fn composite_frame(
}
} else if frame_has_alpha {
for y in 0..height {
let frame_index = (y * frame_width as usize) * 3;
let frame_index = (y * frame_width as usize) * 4;
let canvas_index = (y + frame_offset_y as usize) * canvas_width as usize * 4;

canvas[canvas_index..][..width * 4].copy_from_slice(&frame[frame_index..][..width * 3]);
canvas[canvas_index..][..width * 4].copy_from_slice(&frame[frame_index..][..width * 4]);
}
} else {
for y in 0..height {
Expand Down

0 comments on commit b93b4e6

Please sign in to comment.