Skip to content

Commit 5e9ec66

Browse files
authored
Fix copying pixel buffer in raytracing example (#328)
1 parent b86df58 commit 5e9ec66

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

examples/raytracing/game.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -112,7 +112,7 @@ impl Game {
112112
buffer.pixels_iter().for_each(|(x, y, pixel)| {
113113
let x = (x as f32 / scale_factor) as usize;
114114
let y = (y as f32 / scale_factor) as usize;
115-
if let Some(x) = pixels.get(x * width + y) {
115+
if let Some(x) = pixels.get(y * width + x) {
116116
*pixel = *x;
117117
}
118118
});

0 commit comments

Comments
 (0)