From a945fc102561c116885c325868e925ed0997ac82 Mon Sep 17 00:00:00 2001 From: Yaya-Cout Date: Sat, 1 Jul 2023 20:14:20 +0200 Subject: [PATCH] [python/kandinsky] Fix big font selection --- apps/apps_container_storage.cpp | 2 -- python/port/mod/kandinsky/modkandinsky.cpp | 2 +- python/port/mod/kandinsky/modkandinsky_table.c | 4 ++-- 3 files changed, 3 insertions(+), 5 deletions(-) diff --git a/apps/apps_container_storage.cpp b/apps/apps_container_storage.cpp index ad2dec6197c..25953f269bc 100644 --- a/apps/apps_container_storage.cpp +++ b/apps/apps_container_storage.cpp @@ -49,7 +49,5 @@ int AppsContainerStorage::appIndexFromSnapshot(App::Snapshot * snapshot) { return i; } } - // Achievement unlock : how did you get here ? - assert(false); return NULL; } diff --git a/python/port/mod/kandinsky/modkandinsky.cpp b/python/port/mod/kandinsky/modkandinsky.cpp index 08c0e57cf93..ad7ae12579d 100644 --- a/python/port/mod/kandinsky/modkandinsky.cpp +++ b/python/port/mod/kandinsky/modkandinsky.cpp @@ -62,7 +62,7 @@ mp_obj_t modkandinsky_draw_string(size_t n_args, const mp_obj_t * args) { KDPoint point(mp_obj_get_int(args[1]), mp_obj_get_int(args[2])); KDColor textColor = (n_args >= 4) ? MicroPython::Color::Parse(args[3]) : Palette::PrimaryText; KDColor backgroundColor = (n_args >= 5) ? MicroPython::Color::Parse(args[4]) : Palette::HomeBackground; - bool bigFont = (n_args >= 6) ? mp_obj_is_true(args[5]) : false; + bool bigFont = (n_args >= 6) ? !mp_obj_is_true(args[5]) : true; bool isItalic = (n_args >= 7) ? mp_obj_is_true(args[6]) : false; const KDFont * font = KDFont::LargeFont; if (bigFont && !isItalic) { diff --git a/python/port/mod/kandinsky/modkandinsky_table.c b/python/port/mod/kandinsky/modkandinsky_table.c index 82357609b92..3c991978c3c 100644 --- a/python/port/mod/kandinsky/modkandinsky_table.c +++ b/python/port/mod/kandinsky/modkandinsky_table.c @@ -23,8 +23,8 @@ STATIC const mp_rom_map_elem_t modkandinsky_module_globals_table[] = { { MP_ROM_QSTR(MP_QSTR_fill_rect), (mp_obj_t)&modkandinsky_fill_rect_obj }, { MP_ROM_QSTR(MP_QSTR_fill_circle), (mp_obj_t)&modkandinsky_fill_circle_obj }, { MP_ROM_QSTR(MP_QSTR_fill_polygon), (mp_obj_t)&modkandinsky_fill_polygon_obj }, - { MP_ROM_QSTR(MP_QSTR_large_font), mp_const_true }, - { MP_ROM_QSTR(MP_QSTR_small_font), mp_const_false }, + { MP_ROM_QSTR(MP_QSTR_large_font), mp_const_false }, + { MP_ROM_QSTR(MP_QSTR_small_font), mp_const_true }, { MP_ROM_QSTR(MP_QSTR_wait_vblank), (mp_obj_t)&modkandinsky_wait_vblank_obj }, { MP_ROM_QSTR(MP_QSTR_get_palette), (mp_obj_t)&modkandinsky_get_palette_obj }, };