mirror of
https://github.com/trezor/trezor-firmware.git
synced 2025-04-20 17:19:01 +00:00
chore(core/ui): crash on text too long
This commit is contained in:
parent
3c08ce62b3
commit
d26afc0189
@ -54,6 +54,10 @@ impl<'a> Text<'a> {
|
||||
|
||||
pub fn render<'r>(mut self, renderer: &mut impl Renderer<'r>) {
|
||||
self.bounds = self.calc_bounds();
|
||||
#[cfg(feature = "ui_debug")]
|
||||
if self.font.text_width(self.text) > renderer.viewport().clip.width() {
|
||||
fatal_error!(&uformat!(len: 128, "Text too long: '{}'", self.text));
|
||||
}
|
||||
renderer.render_shape(self);
|
||||
}
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user