Update bitmap4.rs

colors of lower values can now overwrite colors of higher values.
This commit is contained in:
xokz 2023-09-28 14:46:32 -04:00 committed by GitHub
parent 9ab17e7cf6
commit cf80e313b1
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -48,9 +48,9 @@ impl Bitmap4 {
let c = addr.get(x_in_screen, y_in_screen);
if x & 0b1 != 0 {
addr.set(x_in_screen, y_in_screen, c | u16::from(colour) << 8);
addr.set(x_in_screen, y_in_screen, (c & 0xff) | u16::from(colour) << 8);
} else {
addr.set(x_in_screen, y_in_screen, c | u16::from(colour));
addr.set(x_in_screen, y_in_screen, (c & 0xff00) | u16::from(colour));
}
}