summaryrefslogtreecommitdiff
path: root/light-client/tools
diff options
context:
space:
mode:
Diffstat (limited to 'light-client/tools')
-rw-r--r--light-client/tools/src/bin/tex_compose.rs15
1 files changed, 6 insertions, 9 deletions
diff --git a/light-client/tools/src/bin/tex_compose.rs b/light-client/tools/src/bin/tex_compose.rs
index 77e69c45..19c9ed7c 100644
--- a/light-client/tools/src/bin/tex_compose.rs
+++ b/light-client/tools/src/bin/tex_compose.rs
@@ -45,7 +45,7 @@ fn main() {
}
let (name, rest) = line.split_once("=").unwrap();
- let (connects, rest) = rest.split_once(":").unwrap_or(("", rest));
+ let (connects, rest) = rest.split_once(":").unwrap_or(("a", rest));
eprintln!(" compose {name:?} ({connects})");
let mut texels = HashMap::new();
@@ -108,19 +108,16 @@ fn main() {
for (x, y) in texels.keys() {
min_x = min_x.min(*x);
min_y = min_y.min(*y);
- max_x = max_x.max(*x);
- max_y = max_y.max(*y);
+ max_x = max_x.max(*x + 1);
+ max_y = max_y.max(*y + 1);
}
let width = max_x - min_x;
let height = max_y - min_y;
- let mut name = name.to_string();
- if !connects.is_empty() {
- name += "+";
- name += connects;
- }
- let outpath = output_dir.join(name).with_extension("ta");
+ let outpath = output_dir
+ .join(format!("{name}+{connects}"))
+ .with_extension("ta");
let mut output = BufWriter::new(File::create(outpath).unwrap());
for y in 0..height {