From 037dcf82a44a37ac3f2de858aee448e2536f769e Mon Sep 17 00:00:00 2001 From: Gabriel Kaszewski Date: Mon, 23 Mar 2026 02:41:49 +0100 Subject: [PATCH] fix(exporters): saturating cast in draw_text --- crates/exporters/src/image_export.rs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/crates/exporters/src/image_export.rs b/crates/exporters/src/image_export.rs index bfcc0ba..2f3444c 100644 --- a/crates/exporters/src/image_export.rs +++ b/crates/exporters/src/image_export.rs @@ -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); } }