From 9d91c7a69c740023fb96358f7aee56be9806e23f Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Ioan=20Biz=C4=83u?= Date: Fri, 11 Apr 2025 09:41:17 +0200 Subject: [PATCH] chore(eckhart): check button subtitle overflow [no changelog] --- core/embed/rust/src/ui/layout_eckhart/component/button.rs | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/core/embed/rust/src/ui/layout_eckhart/component/button.rs b/core/embed/rust/src/ui/layout_eckhart/component/button.rs index 051e7d9b7b..18232edf30 100644 --- a/core/embed/rust/src/ui/layout_eckhart/component/button.rs +++ b/core/embed/rust/src/ui/layout_eckhart/component/button.rs @@ -463,6 +463,10 @@ impl Button { }); subtext.map(|subtext| { + #[cfg(feature = "ui_debug")] + if subtext_style.text_font.text_width(subtext) > self.area.width() { + fatal_error!(&uformat!(len: 128, "Subtext too long: '{}'", subtext)); + } shape::Text::new( render_origin(if single_line_text { text_baseline_height / 2