mirror of
https://github.com/dankamongmen/notcurses
synced 2025-03-09 17:19:03 -04:00
render: don't check tcache->cuf until necessary
This commit is contained in:
parent
60fb4a2351
commit
4c15436de8
@ -719,12 +719,12 @@ stage_cursor(notcurses* nc, FILE* out, int y, int x){
|
||||
if(nc->rstate.y == y){ // only need move x
|
||||
const int xdiff = x - nc->rstate.x;
|
||||
if(xdiff > 0){
|
||||
if(nc->tcache.cuf && nc->tcache.cuf1){
|
||||
if(xdiff == 1){
|
||||
ret = term_emit("cuf1", tiparm(nc->tcache.cuf1), out, false);
|
||||
}else{
|
||||
ret = term_emit("cuf", tiparm(nc->tcache.cuf, xdiff), out, false);
|
||||
}
|
||||
if(xdiff == 1 && nc->tcache.cuf1){
|
||||
ret = term_emit("cuf1", tiparm(nc->tcache.cuf1), out, false);
|
||||
nc->rstate.x = x;
|
||||
return ret;
|
||||
}else if(nc->tcache.cuf){
|
||||
ret = term_emit("cuf", tiparm(nc->tcache.cuf, xdiff), out, false);
|
||||
nc->rstate.x = x;
|
||||
return ret;
|
||||
}
|
||||
@ -733,6 +733,7 @@ stage_cursor(notcurses* nc, FILE* out, int y, int x){
|
||||
}
|
||||
// cub1/cub tend to be destructive in my experiments :/
|
||||
}
|
||||
// cup is required, no need to check for existence
|
||||
ret = term_emit("cup", tiparm(nc->tcache.cup, y, x), out, false);
|
||||
if(ret == 0){
|
||||
nc->rstate.x = x;
|
||||
|
Loading…
x
Reference in New Issue
Block a user