diff --git a/src/lib.rs b/src/lib.rs index 590b94c..979abad 100644 --- a/src/lib.rs +++ b/src/lib.rs @@ -50,8 +50,8 @@ pub fn add_tiles(game_data: String, image: String, prefix: String) -> String { for row in 0..rows { let mut pixels = Vec::with_capacity(64); - for x in (column * SD)..((column + 1) * SD) { - for y in (row * SD)..((row + 1) * SD) { + for y in (row * SD)..((row + 1) * SD) { + for x in (column * SD)..((column + 1) * SD) { let pixel = image.get_pixel(x, y).to_rgb(); let total: u32 = (pixel[0] as u32 + pixel[1] as u32 + pixel[2] as u32) as u32; // is each channel brighter than 128/255 on average?