GUI: Fix Dark Mode after XOR canvas color

This commit is contained in:
Willy-JL
2024-08-02 23:58:13 +02:00
parent 298f734a93
commit a28b840992
2 changed files with 9 additions and 1 deletions

View File

@@ -14,6 +14,7 @@
- OFW: FBT: Toolchain v39 (by @hedger) - OFW: FBT: Toolchain v39 (by @hedger)
### Fixed: ### Fixed:
- GUI: Fix Dark Mode after XOR canvas color, like in NFC dict attack (by @Willy-JL)
- OFW: NFC: Fix plantain balance string (by @Astrrra) - OFW: NFC: Fix plantain balance string (by @Astrrra)
- OFW: JS: Ensure proper closure of variadic function in `mjs_array` (by @derskythe) - OFW: JS: Ensure proper closure of variadic function in `mjs_array` (by @derskythe)

View File

@@ -171,7 +171,14 @@ void canvas_set_font_direction(Canvas* canvas, CanvasDirection dir) {
} }
void canvas_invert_color(Canvas* canvas) { void canvas_invert_color(Canvas* canvas) {
canvas->fb.draw_color = !canvas->fb.draw_color; if(canvas->fb.draw_color == ColorXOR && momentum_settings.dark_mode) {
// XOR is 0x02, invert changes it to 0x00 which is White
// Basically like resetting to background color
// In Dark Mode, background color is Black instead
canvas->fb.draw_color = ColorBlack;
} else {
canvas->fb.draw_color = !canvas->fb.draw_color;
}
} }
void canvas_set_font(Canvas* canvas, Font font) { void canvas_set_font(Canvas* canvas, Font font) {