1
0
mirror of https://github.com/trezor/trezor-firmware.git synced 2025-04-11 04:45:45 +00:00

fix(core): fix rendering of outlined Bars

[no changelog]
This commit is contained in:
tychovrahe 2025-02-24 16:02:23 +01:00 committed by TychoVrahe
parent 91ee49c20b
commit 4af18b66eb

View File

@ -87,10 +87,46 @@ impl Shape<'_> for Bar {
// outline
if th > 0 {
let r = self.area;
canvas.fill_rect(Rect { y1: r.y0 + th, ..r }, fg_color, self.alpha);
canvas.fill_rect(Rect { x1: r.x0 + th, ..r }, fg_color, self.alpha);
canvas.fill_rect(Rect { x0: r.x1 - th, ..r }, fg_color, self.alpha);
canvas.fill_rect(Rect { y0: r.y1 - th, ..r }, fg_color, self.alpha);
// top
canvas.fill_rect(
Rect {
y1: r.y0 + th,
x1: r.x1 - th,
..r
},
fg_color,
self.alpha,
);
// left
canvas.fill_rect(
Rect {
x1: r.x0 + th,
y0: r.y0 + th,
..r
},
fg_color,
self.alpha,
);
// right
canvas.fill_rect(
Rect {
x0: r.x1 - th,
y1: r.y1 - th,
..r
},
fg_color,
self.alpha,
);
// bottom
canvas.fill_rect(
Rect {
y0: r.y1 - th,
x0: r.x0 + th,
..r
},
fg_color,
self.alpha,
);
}
}
if let Some(bg_color) = self.bg_color {