Skip to content

Commit

Permalink
[python/kandinsky] Fix big font selection
Browse files Browse the repository at this point in the history
  • Loading branch information
Yaya-Cout committed Jul 1, 2023
1 parent 6976e52 commit a945fc1
Show file tree
Hide file tree
Showing 3 changed files with 3 additions and 5 deletions.
2 changes: 0 additions & 2 deletions apps/apps_container_storage.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,5 @@ int AppsContainerStorage::appIndexFromSnapshot(App::Snapshot * snapshot) {
return i;
}
}
// Achievement unlock : how did you get here ?
assert(false);
return NULL;
}
2 changes: 1 addition & 1 deletion python/port/mod/kandinsky/modkandinsky.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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) {
Expand Down
4 changes: 2 additions & 2 deletions python/port/mod/kandinsky/modkandinsky_table.c
Original file line number Diff line number Diff line change
Expand Up @@ -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 },
};
Expand Down

0 comments on commit a945fc1

Please sign in to comment.