mirror of
https://github.com/dankamongmen/notcurses
synced 2025-03-10 09:39:03 -04:00
don't call ncplane_dim_yx() in notcurses_render_internal
This commit is contained in:
parent
67b5a20758
commit
3011a59cbd
@ -297,8 +297,9 @@ notcurses_render_internal(notcurses* nc, struct crender* rvec){
|
||||
if(reshape_shadow_fb(nc)){
|
||||
return -1;
|
||||
}
|
||||
int dimy, dimx;
|
||||
notcurses_term_dim_yx(nc, &dimy, &dimx);
|
||||
// don't use ncplane_dim_yx()/ncplane_yx() here, lest we deadlock
|
||||
int dimy = nc->stdscr->leny;
|
||||
int dimx = nc->stdscr->lenx;
|
||||
cell* fb = malloc(sizeof(*fb) * dimy * dimx);
|
||||
for(int y = 0 ; y < dimy ; ++y){
|
||||
for(int x = 0 ; x < dimx ; ++x){
|
||||
@ -677,12 +678,12 @@ int notcurses_render(notcurses* nc){
|
||||
bytes = notcurses_rasterize(nc, crender);
|
||||
}
|
||||
free(crender);
|
||||
int dimy, dimx;
|
||||
notcurses_resize(nc, &dimy, &dimx);
|
||||
clock_gettime(CLOCK_MONOTONIC_RAW, &done);
|
||||
update_render_stats(&done, &start, &nc->stats, bytes);
|
||||
ret = bytes >= 0 ? 0 : -1;
|
||||
pthread_cleanup_pop(1);
|
||||
int dimy, dimx;
|
||||
notcurses_resize(nc, &dimy, &dimx);
|
||||
return ret;
|
||||
}
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user