1
0
mirror of https://github.com/trezor/trezor-firmware.git synced 2025-03-20 18:16:05 +00:00

fix(core): fix blending mono 4 on mono 8 canvas

[no changelog]
This commit is contained in:
tychovrahe 2024-08-23 15:07:05 +02:00 committed by TychoVrahe
parent 24c0552a43
commit 41273a25ed

View File

@ -103,7 +103,7 @@ void gfx_mono8_blend_mono4(const gfx_bitblt_t* bb) {
uint8_t src_data = src_row[(x + bb->src_x) / 2];
uint8_t src_alpha = (x + bb->src_x) & 1 ? src_data >> 4 : src_data & 0x0F;
src_alpha = src_alpha * bb->src_alpha / 15;
dst_ptr[x] = (fg * src_alpha + dst_ptr[x] * (255 - src_alpha));
dst_ptr[x] = (fg * src_alpha + dst_ptr[x] * (255 - src_alpha)) / 255;
}
dst_ptr += bb->dst_stride / sizeof(*dst_ptr);
src_row += bb->src_stride / sizeof(*src_row);