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:
parent
579cc0d882
commit
d0a702eef4
@ -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 y in 0..clamped.height() {
|
||||||
for x in 0..clamped.width() {
|
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;
|
let byte_idx = pixel / 2;
|
||||||
if byte_idx < buffer.buffer.len() as _ {
|
if byte_idx < buffer.buffer.len() as _ {
|
||||||
let data = if pixel % 2 != 0 {
|
let data = if pixel % 2 != 0 {
|
||||||
buffer.buffer[byte_idx as usize] >> 4
|
buffer.buffer[byte_idx] >> 4
|
||||||
} else {
|
} else {
|
||||||
buffer.buffer[byte_idx as usize] & 0xF
|
buffer.buffer[byte_idx] & 0xF
|
||||||
};
|
};
|
||||||
pixeldata(tbl[data as usize]);
|
pixeldata(tbl[data as usize]);
|
||||||
} else {
|
} else {
|
||||||
|
Loading…
Reference in New Issue
Block a user