demo: change plot to 2Hz to avoid gaps

This commit is contained in:
nick black 2020-12-09 00:30:09 -05:00
parent a3220b8a73
commit 22790943bc
No known key found for this signature in database
GPG Key ID: 5F43400C21CBFACC
2 changed files with 3 additions and 3 deletions

View File

@ -26,7 +26,7 @@ static int plot_grab_y = -1;
// position of the plot *when grab started* // position of the plot *when grab started*
static int plot_pos_y; static int plot_pos_y;
#define FPSHZ 10 #define FPSHZ 2
// how many columns for runtime? // how many columns for runtime?
#define HUD_ROWS (3 + 2) // 2 for borders #define HUD_ROWS (3 + 2) // 2 for borders
@ -642,7 +642,7 @@ int fpsgraph_init(struct notcurses* nc){
NCPLOT_OPTION_PRINTSAMPLE; NCPLOT_OPTION_PRINTSAMPLE;
opts.gridtype = NCBLIT_BRAILLE; opts.gridtype = NCBLIT_BRAILLE;
opts.legendstyle = NCSTYLE_ITALIC | NCSTYLE_BOLD; opts.legendstyle = NCSTYLE_ITALIC | NCSTYLE_BOLD;
opts.title = "frames per decisecond"; opts.title = "frames per semisecond";
channels_set_fg_rgb8(&opts.minchannels, 0x80, 0x80, 0xff); channels_set_fg_rgb8(&opts.minchannels, 0x80, 0x80, 0xff);
channels_set_bg_rgb(&opts.minchannels, 0x201020); channels_set_bg_rgb(&opts.minchannels, 0x201020);
channels_set_bg_alpha(&opts.minchannels, CELL_ALPHA_BLEND); channels_set_bg_alpha(&opts.minchannels, CELL_ALPHA_BLEND);

View File

@ -286,7 +286,7 @@ class ncppplot {
if(printsample){ if(printsample){
int lastslot = slotstart ? slotstart - 1 : slotcount - 1; int lastslot = slotstart ? slotstart - 1 : slotcount - 1;
ncplane_set_styles(ncp, legendstyle); ncplane_set_styles(ncp, legendstyle);
ncplane_printf_aligned(ncp, dimy - 1, NCALIGN_RIGHT, "%ju", (uintmax_t)slots[lastslot]); ncplane_printf_aligned(ncp, 0, NCALIGN_RIGHT, "%ju", (uintmax_t)slots[lastslot]);
} }
ncplane_home(ncp); ncplane_home(ncp);
return 0; return 0;