diff --git a/src/demo/yield.c b/src/demo/yield.c index 828e47c30..aa74cf4b1 100644 --- a/src/demo/yield.c +++ b/src/demo/yield.c @@ -74,6 +74,9 @@ int yield_demo(struct notcurses* nc){ ncplane_set_bg_rgb(std, 0x10, 0x10, 0x10); ncplane_set_fg_rgb(std, 0xf0, 0x20, 0x20); ncplane_set_attr(std, NCSTYLE_BOLD); + if(tfilled > threshold_painted){ + tfilled = threshold_painted; // don't allow printing of 100.1% etc + } ncplane_printf_aligned(std, 3, NCALIGN_CENTER, "Yield: %3.1f%%", ((double)tfilled * 100) / threshold_painted); ncplane_set_attr(std, NCSTYLE_NONE); DEMO_RENDER(nc);