Fix text_box red and blue channels being swapped
This commit is contained in:
parent
3b8254020f
commit
94fe82f38e
1 changed files with 7 additions and 1 deletions
|
|
@ -344,7 +344,13 @@ where
|
|||
&mut SWASH_CACHE.lock().unwrap(),
|
||||
text_color,
|
||||
|x, y, w, h, color| {
|
||||
draw_rect(buffer, image_w, image_h, x, y, w as i32, h as i32, color.0);
|
||||
// Grab alpha channel and green channel
|
||||
let mut image_color = color.0 & 0xFF00FF00;
|
||||
// Shift red channel
|
||||
image_color |= (color.0 & 0x00FF0000) >> 16;
|
||||
// Shift blue channel
|
||||
image_color |= (color.0 & 0x000000FF) << 16;
|
||||
draw_rect(buffer, image_w, image_h, x, y, w as i32, h as i32, image_color);
|
||||
},
|
||||
);
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue