From d317af4b6c7c1ee98bec47493b2bf9940d63b4ca Mon Sep 17 00:00:00 2001 From: Jonathan Behrens Date: Sun, 24 Dec 2023 10:40:04 -0800 Subject: [PATCH] Fix indexing issue --- src/extended.rs | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/extended.rs b/src/extended.rs index 44dafc9..4639836 100644 --- a/src/extended.rs +++ b/src/extended.rs @@ -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 {