1
0
mirror of https://github.com/trezor/trezor-firmware.git synced 2024-11-18 05:28:40 +00:00

fix(core): fix large area marquee rendering

[no changelog]
This commit is contained in:
tychovrahe 2023-12-12 22:56:01 +01:00 committed by TychoVrahe
parent 579cc0d882
commit d0a702eef4

View File

@ -1045,13 +1045,13 @@ pub fn marquee(area: Rect, text: &str, offset: i16, font: Font, fg: Color, bg: C
for y in 0..clamped.height() {
for x in 0..clamped.width() {
let pixel = y * constant::WIDTH + x;
let pixel = y as usize * constant::WIDTH as usize + x as usize;
let byte_idx = pixel / 2;
if byte_idx < buffer.buffer.len() as _ {
let data = if pixel % 2 != 0 {
buffer.buffer[byte_idx as usize] >> 4
buffer.buffer[byte_idx] >> 4
} else {
buffer.buffer[byte_idx as usize] & 0xF
buffer.buffer[byte_idx] & 0xF
};
pixeldata(tbl[data as usize]);
} else {