fix(core): fix eckhart performance overlay
What changed, and why it matters
This commit fixes the visual alignment and font of a performance debugging overlay on the Trezor Safe 5 (Eckhart layout). It changes where on-screen text is drawn so numbers are not clipped by rounded screen corners. There is no security relevance: it only affects a developer-only overlay that shows rendering timing statistics.
No security action required. Treat as a normal UI/debug-overlay fix.
Security signals we found
No strong security signals were identified.
Evidence from the diff
The patch adjusts render_performance_overlay() in core/embed/rust/src/ui/layout_eckhart/mod.rs. It introduces a curve_offset padding to account for the device’s rounded display corners, switches from FONT_SATOSHI_REGULAR_22 to FONT_SATOSHI_MEDIUM_26, and repositions the text baseline so the overlay remains readable. The overlay is gated behind a performance/debug feature and is not user-facing in production.
Changed components
core/embed/rust/src/ui/layout_eckhart/mod.rsInspect captured patch +12 / −7
diff --git a/core/embed/rust/src/ui/layout_eckhart/mod.rs b/core/embed/rust/src/ui/layout_eckhart/mod.rs
index 871bb04be..2603c75ad 100644
--- a/core/embed/rust/src/ui/layout_eckhart/mod.rs
+++ b/core/embed/rust/src/ui/layout_eckhart/mod.rs
@@ -106,6 +106,7 @@ impl CommonUI for UIEckhart {
target: &mut impl shape::Renderer<'s>,
info: PerformanceOverlay,
) {
+ let curve_offset = Offset::new(10, 10);
let mut text = ShortString::new();
let t1 = info.render_time.min(99999) as u32;
let t2 = info.refresh_time.min(99999) as u32;
@@ -117,20 +118,24 @@ impl CommonUI for UIEckhart {
t2 / 1000,
(t2 % 1000) / 100
));
- let font = fonts::FONT_SATOSHI_REGULAR_22;
+ let font = fonts::FONT_SATOSHI_MEDIUM_26;
let size = Offset::new(
font.visible_text_width("00.0|00.0"),
- font.visible_text_height("0"),
- );
+ font.visible_text_height("0|"),
+ ) + curve_offset;
let pos = Point::new(constant::WIDTH, 0);
let r = Rect::snap(pos, size, Alignment2D::TOP_RIGHT);
shape::Bar::new(r)
.with_alpha(192)
.with_bg(Color::black())
.render(target);
- shape::Text::new(r.bottom_right(), &text, font)
- .with_align(Alignment::End)
- .with_fg(Color::rgb(255, 255, 0))
- .render(target);
+ shape::Text::new(
+ r.bottom_right() - Offset::new(curve_offset.x, font.baseline),
+ &text,
+ font,
+ )
+ .with_align(Alignment::End)
+ .with_fg(Color::rgb(255, 255, 0))
+ .render(target);
}
}
Why this scored 15/100
Community notes
Notes can correct, qualify, or add evidence to the AI analysis. Every note shown here has been validated by a human moderator.
The AI analysis stands alone for now. Submit a note if you can add evidence or important context.