fix(core/bootloader): fix unsafe fw warning screen alignment
What changed, and why it matters
This commit fixes the horizontal centering of a small vendor logo shown on the bootloader's 'unsafe firmware' warning screen. The old code subtracted 22 pixels from the screen width before dividing by two, which would slightly offset the 24x24 image. The new code simply centers the image using the screen's midpoint. There is no security-relevant change in the diff itself.
No security action needed. Treat as a normal UI polish fix.
Security signals we found
No strong security signals were identified.
Evidence from the diff
In core/embed/rust/src/ui/layout_caesar/bootloader/mod.rs, the unsafe firmware warning screen positions a 24x24 vendor TOIF image. The previous calculation Point::new((constant::WIDTH - 22) / 2, 0) effectively shifted the image left by 11 pixels relative to true center. The patch changes it to Point::new(constant::WIDTH / 2, 0), relying on the existing Alignment2D::TOP_CENTER to center the image correctly. The change is purely visual alignment.
Changed components
core/embed/rust/src/ui/layout_caesar/bootloader/mod.rsInspect captured patch +1 / −1
diff --git a/core/embed/rust/src/ui/layout_caesar/bootloader/mod.rs b/core/embed/rust/src/ui/layout_caesar/bootloader/mod.rs
index fe99086c..be2da7f6 100644
--- a/core/embed/rust/src/ui/layout_caesar/bootloader/mod.rs
+++ b/core/embed/rust/src/ui/layout_caesar/bootloader/mod.rs
@@ -364,7 +364,7 @@ impl BootloaderUI for UICaesar {
// Draw vendor image if it's valid and has size of 24x24
if let Ok(toif) = Toif::new(vendor_img) {
if (toif.width() == 24) && (toif.height() == 24) {
- let pos = Point::new((constant::WIDTH - 22) / 2, 0);
+ let pos = Point::new(constant::WIDTH / 2, 0);
shape::ToifImage::new(pos, toif)
.with_align(Alignment2D::TOP_CENTER)
.with_fg(BLD_FG)
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.