mirror of
https://github.com/dankamongmen/notcurses
synced 2025-03-10 01:29:05 -04:00
yield: don't print overyield
This commit is contained in:
parent
dd53764df2
commit
94aa0aaa76
@ -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);
|
||||
|
Loading…
x
Reference in New Issue
Block a user