allocate texture data vec with room for 3 bytes per pixel

This commit is contained in:
Seth Pyle 2024-06-06 11:59:16 -05:00 committed by Jonathan Spira
parent 5d771a83b8
commit 67f7f11363

View File

@ -129,7 +129,7 @@ impl TexturesUi {
const WIDTH: usize = 100;
const HEIGHT: usize = 100;
let mut data = Vec::with_capacity(WIDTH * HEIGHT);
let mut data = Vec::with_capacity(WIDTH * HEIGHT * 3);
for i in 0..WIDTH {
for j in 0..HEIGHT {
// Insert RGB values