Skip to content

Commit

Permalink
fix: scale not affecting tile_res with --hr (#25)
Browse files Browse the repository at this point in the history
  • Loading branch information
fgardt authored Mar 27, 2024
1 parent 681f1ff commit 20f2422
Show file tree
Hide file tree
Showing 3 changed files with 8 additions and 6 deletions.
2 changes: 1 addition & 1 deletion Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion Cargo.toml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
[package]
name = "spritter"
version = "0.5.1"
version = "0.5.2"
edition = "2021"
authors = ["fgardt <[email protected]>"]
description = "Spritesheet generator for factorio"
Expand Down
10 changes: 6 additions & 4 deletions src/main.rs
Original file line number Diff line number Diff line change
Expand Up @@ -250,11 +250,13 @@ impl SpritesheetArgs {
}

fn tile_res(&self) -> usize {
if self.hr {
64
let res = if self.hr {
64.0
} else {
(self.tile_resolution as f64 * self.scale).round() as usize
}
self.tile_resolution as f64
};

(res * self.scale).round() as usize
}
}

Expand Down

0 comments on commit 20f2422

Please sign in to comment.