Merge pull request #4454 from jepler/bitmaptools-readinto-4bit

Fix reading 4-bit data
This commit is contained in:
Jeff Epler 2021-03-21 19:56:23 -05:00 committed by GitHub
commit a05aab8304
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -441,7 +441,7 @@ void common_hal_bitmaptools_readinto(displayio_bitmap_t *self, pyb_file_obj_t *f
int byte_offset = x / 2;
int bit_offset = 4 * (reverse_pixels_in_element ? (1 - x % 2) : x % 2);
value = (rowdata8[byte_offset] >> bit_offset) & 7;
value = (rowdata8[byte_offset] >> bit_offset) & 0xf;
break;
}
case 8: