core: fix last commit

pull/106/head
Pavol Rusnak 5 years ago
parent c761351afa
commit a89a3bf6db
No known key found for this signature in database
GPG Key ID: 91F3B339B9A02A3D

@ -362,7 +362,7 @@ void display_loader(uint16_t progress, bool indeterminate, int yoffset,
}
// inside of circle - draw glyph
#define LOADER_ICON_CORNER_CUT 2
#define LOADER_INDETERMINATE_WIDTH 125
#define LOADER_INDETERMINATE_WIDTH 100
if (icon &&
mx + my > (((LOADER_ICON_SIZE / 2) + LOADER_ICON_CORNER_CUT) * 2) &&
mx >= img_loader_size - (LOADER_ICON_SIZE / 2) &&
@ -380,8 +380,8 @@ void display_loader(uint16_t progress, bool indeterminate, int yoffset,
} else {
uint8_t c;
if (indeterminate) {
uint16_t diff = (progress > a) ? (progress - a) : (a - progress);
if (diff < LOADER_INDETERMINATE_WIDTH) {
uint16_t diff = (progress > a) ? (progress - a) : (1000 + progress - a);
if (diff < LOADER_INDETERMINATE_WIDTH || diff > 1000 - LOADER_INDETERMINATE_WIDTH) {
c = (img_loader[my][mx] & 0x00F0) >> 4;
} else {
c = img_loader[my][mx] & 0x000F;

@ -176,6 +176,6 @@ async def live_refresh_step(ctx, current):
step = 8
p = (1000 * current // step) % 1000
ui.display.loader(p, True, 18, ui.WHITE, ui.BG, None, 0)
ui.display.loader(p, True, 18, ui.WHITE, ui.BG)
ui.display.text_center(ui.WIDTH // 2, 145, "%d" % current, ui.NORMAL, ui.FG, ui.BG)
ui.display.refresh()

Loading…
Cancel
Save