mirror of
https://github.com/trezor/trezor-firmware.git
synced 2025-06-17 21:48:47 +00:00
fix(core): fix rendering of outlined Bars
[no changelog]
This commit is contained in:
parent
91ee49c20b
commit
4af18b66eb
@ -87,10 +87,46 @@ impl Shape<'_> for Bar {
|
|||||||
// outline
|
// outline
|
||||||
if th > 0 {
|
if th > 0 {
|
||||||
let r = self.area;
|
let r = self.area;
|
||||||
canvas.fill_rect(Rect { y1: r.y0 + th, ..r }, fg_color, self.alpha);
|
// top
|
||||||
canvas.fill_rect(Rect { x1: r.x0 + th, ..r }, fg_color, self.alpha);
|
canvas.fill_rect(
|
||||||
canvas.fill_rect(Rect { x0: r.x1 - th, ..r }, fg_color, self.alpha);
|
Rect {
|
||||||
canvas.fill_rect(Rect { y0: r.y1 - th, ..r }, fg_color, self.alpha);
|
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 {
|
if let Some(bg_color) = self.bg_color {
|
||||||
|
Loading…
Reference in New Issue
Block a user