diff --git a/Cargo.lock b/Cargo.lock index 958d477..2267bd2 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -980,7 +980,7 @@ dependencies = [ [[package]] name = "spritter" -version = "0.8.0" +version = "0.8.1" dependencies = [ "clap", "env_logger", diff --git a/Cargo.toml b/Cargo.toml index e05f802..c0e5db8 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -1,6 +1,6 @@ [package] name = "spritter" -version = "0.8.0" +version = "0.8.1" edition = "2021" authors = ["fgardt "] description = "Spritesheet generator for factorio" diff --git a/src/main.rs b/src/main.rs index 4bbdeff..44c2d4d 100644 --- a/src/main.rs +++ b/src/main.rs @@ -787,8 +787,8 @@ fn generate_subframe_sheets( .iter() .map(|(frags, (width, height), (shift_x, shift_y))| { let cols = MAX_SIZE / width; - let rows = MAX_SIZE / height; let sheet_width = cols * width; + let rows = sprite_count.div_ceil(cols); let sheet_height = rows * height; let mut sheet = RgbaImage::new(sheet_width, sheet_height);