summary: fix minima trackers

pull/124/head
nick black 5 years ago
parent 6e73e3b72f
commit 774f8e5a23
No known key found for this signature in database
GPG Key ID: 5F43400C21CBFACC

@ -852,18 +852,12 @@ cells_load_box(struct ncplane* n, uint32_t attrs, uint64_t channels,
cell* ul, cell* ur, cell* ll, cell* lr,
cell* hl, cell* vl, const char* gclusters){
int ulen;
if((ulen = cell_load(n, ul, gclusters)) > 0){
if((ulen = cell_load(n, ur, gclusters += ulen)) > 0){
if((ulen = cell_load(n, ll, gclusters += ulen)) > 0){
if((ulen = cell_load(n, lr, gclusters += ulen)) > 0){
if((ulen = cell_load(n, hl, gclusters += ulen)) > 0){
if((ulen = cell_load(n, vl, gclusters += ulen)) > 0){
ul->attrword = attrs; ul->channels = channels;
ur->attrword = attrs; ur->channels = channels;
ll->attrword = attrs; ll->channels = channels;
lr->attrword = attrs; lr->channels = channels;
hl->attrword = attrs; hl->channels = channels;
vl->attrword = attrs; vl->channels = channels;
if((ulen = cell_prime(n, ul, gclusters, attrs, channels)) > 0){
if((ulen = cell_prime(n, ur, gclusters += ulen, attrs, channels)) > 0){
if((ulen = cell_prime(n, ll, gclusters += ulen, attrs, channels)) > 0){
if((ulen = cell_prime(n, lr, gclusters += ulen, attrs, channels)) > 0){
if((ulen = cell_prime(n, hl, gclusters += ulen, attrs, channels)) > 0){
if((ulen = cell_prime(n, vl, gclusters += ulen, attrs, channels)) > 0){
return 0;
}
cell_release(n, hl);
@ -879,6 +873,7 @@ cells_load_box(struct ncplane* n, uint32_t attrs, uint64_t channels,
return -1;
}
static inline int
cells_rounded_box(struct ncplane* n, uint32_t attr, uint64_t channels,
cell* ul, cell* ur, cell* ll, cell* lr, cell* hl, cell* vl){

@ -714,18 +714,12 @@ cells_load_box(struct ncplane* n, uint32_t attrs, uint64_t channels,
cell* ul, cell* ur, cell* ll, cell* lr,
cell* hl, cell* vl, const char* gclusters){
int ulen;
if((ulen = cell_load(n, ul, gclusters)) > 0){
if((ulen = cell_load(n, ur, gclusters += ulen)) > 0){
if((ulen = cell_load(n, ll, gclusters += ulen)) > 0){
if((ulen = cell_load(n, lr, gclusters += ulen)) > 0){
if((ulen = cell_load(n, hl, gclusters += ulen)) > 0){
if((ulen = cell_load(n, vl, gclusters += ulen)) > 0){
ul->attrword = attrs; ul->channels = channels;
ur->attrword = attrs; ur->channels = channels;
ll->attrword = attrs; ll->channels = channels;
lr->attrword = attrs; lr->channels = channels;
hl->attrword = attrs; hl->channels = channels;
vl->attrword = attrs; vl->channels = channels;
if((ulen = cell_prime(n, ul, gclusters, attrs, channels)) > 0){
if((ulen = cell_prime(n, ur, gclusters += ulen, attrs, channels)) > 0){
if((ulen = cell_prime(n, ll, gclusters += ulen, attrs, channels)) > 0){
if((ulen = cell_prime(n, lr, gclusters += ulen, attrs, channels)) > 0){
if((ulen = cell_prime(n, hl, gclusters += ulen, attrs, channels)) > 0){
if((ulen = cell_prime(n, vl, gclusters += ulen, attrs, channels)) > 0){
return 0;
}
cell_release(n, hl);

@ -133,6 +133,7 @@ draw_bounding_box(struct ncplane* n, int yoff, int xoff, int chunky, int chunkx)
int ret;
uint64_t channels = 0;
notcurses_fg_prep(&channels, 180, 80, 180);
//notcurses_bg_prep(&channels, 0, 0, 0);
ncplane_cursor_move_yx(n, yoff, xoff);
ret = ncplane_rounded_box(n, 0, channels,
CHUNKS_VERT * chunky + yoff + 1,

@ -234,8 +234,8 @@ int prep_special_keys(notcurses* nc){
continue;
}
if(seq[0] != ESC){
fprintf(stderr, "Terminfo's %s is not an escape sequence: %s\n",
k->tinfo, seq);
fprintf(stderr, "Terminfo's %s is not an escape sequence (%zub)\n",
k->tinfo, strlen(seq));
continue;
}
//fprintf(stderr, "support for terminfo's %s: %s\n", k->tinfo, seq);

@ -600,8 +600,8 @@ notcurses* notcurses_init(const notcurses_options* opts){
return NULL;
}
memset(&ret->stats, 0, sizeof(ret->stats));
ret->stats.render_min_ns = ~0UL;
ret->stats.render_min_bytes = ~0UL;
ret->stats.render_min_ns = 1ul << 62u;
ret->stats.render_min_bytes = 1ul << 62u;
ret->ttyfp = opts->outfp;
ret->renderfp = opts->renderfp;
ret->inputescapes = NULL;

@ -60,7 +60,7 @@ int wresize(ncplane* n, int leny, int lenx){
// bchrs: 6-element array of wide border characters + attributes FIXME
static int
draw_borders(ncplane* w, unsigned nobordermask, const cell* attr,
draw_borders(ncplane* w, unsigned mask, const cell* attr,
bool cliphead, bool clipfoot){
int begx, begy, lenx, leny;
int ret = 0;
@ -76,22 +76,22 @@ draw_borders(ncplane* w, unsigned nobordermask, const cell* attr,
return -1;
}
/*fprintf(stderr, "drawing borders %p %d/%d->%d/%d, mask: %04x, clipping: %c%c\n",
w, begx, begy, maxx, maxy, nobordermask,
w, begx, begy, maxx, maxy, mask,
cliphead ? 'T' : 't', clipfoot ? 'F' : 'f');*/
if(!cliphead){
// lenx - begx + 1 is the number of columns we have, but drop 2 due to
// corners. we thus want lenx - begx - 1 horizontal lines.
if(!(nobordermask & NCBOXMASK_TOP)){
if(!(mask & NCBOXMASK_TOP)){
ret |= ncplane_cursor_move_yx(w, begy, begx);
ncplane_putc(w, &ul);
ncplane_hline(w, &hl, lenx - 2);
ncplane_putc(w, &ur);
}else{
if(!(nobordermask & NCBOXMASK_LEFT)){
if(!(mask & NCBOXMASK_LEFT)){
ret |= ncplane_cursor_move_yx(w, begy, begx);
ncplane_putc(w, &ul);
}
if(!(nobordermask & NCBOXMASK_RIGHT)){
if(!(mask & NCBOXMASK_RIGHT)){
ret |= ncplane_cursor_move_yx(w, begy, maxx);
ncplane_putc(w, &ur);
}
@ -99,27 +99,27 @@ draw_borders(ncplane* w, unsigned nobordermask, const cell* attr,
}
int y;
for(y = begy + !cliphead ; y < maxy + !!clipfoot ; ++y){
if(!(nobordermask & NCBOXMASK_LEFT)){
if(!(mask & NCBOXMASK_LEFT)){
ret |= ncplane_cursor_move_yx(w, y, begx);
ncplane_putc(w, &vl);
}
if(!(nobordermask & NCBOXMASK_RIGHT)){
if(!(mask & NCBOXMASK_RIGHT)){
ret |= ncplane_cursor_move_yx(w, y, maxx);
ncplane_putc(w, &vl);
}
}
if(!clipfoot){
if(!(nobordermask & NCBOXMASK_BOTTOM)){
if(!(mask & NCBOXMASK_BOTTOM)){
ret |= ncplane_cursor_move_yx(w, maxy, begx);
ncplane_putc(w, &ll);
ncplane_hline(w, &hl, lenx - 2);
ncplane_putc(w, &lr);
}else{
if(!(nobordermask & NCBOXMASK_LEFT)){
if(!(mask & NCBOXMASK_LEFT)){
ret |= ncplane_cursor_move_yx(w, maxy, begx);
ret |= ncplane_putc(w, &ll);
}
if(!(nobordermask & NCBOXMASK_RIGHT)){
if(!(mask & NCBOXMASK_RIGHT)){
// mvwadd_wch returns error if we print to the lowermost+rightmost
// character cell. maybe we can make this go away with scrolling controls
// at setup? until then, don't check for error here FIXME.

Loading…
Cancel
Save