diff --git a/src/trekstor.rs b/src/trekstor.rs index 1aa551d..a31ffe5 100644 --- a/src/trekstor.rs +++ b/src/trekstor.rs @@ -72,6 +72,10 @@ impl Platform for Trekstor { dbg!("Rendering"); renderer.render(&mut buffer1, ctx.screen.width() as usize); for (i, px) in buffer1.into_iter().enumerate() { + if i > (ctx.screen.width() as usize - 1) { + break; + } + let x = (i % ctx.screen.width() as usize) as u32; let y = (i / ctx.screen.width() as usize) as u32;