fix(exporters): saturating cast in draw_text

This commit is contained in:
2026-03-23 02:41:49 +01:00
parent 01f64caea1
commit 037dcf82a4

View File

@@ -208,7 +208,7 @@ fn draw_char(img: &mut RgbaImage, x: u32, y: u32, ch: char, scale: u32, color: [
fn draw_text(img: &mut RgbaImage, x: u32, y: u32, text: &str, scale: u32, color: [u8; 4]) {
let char_w = 6 * scale;
for (i, ch) in text.chars().enumerate() {
draw_char(img, x + i as u32 * char_w, y, ch, scale, color);
draw_char(img, x + (i as u32).saturating_mul(char_w), y, ch, scale, color);
}
}