Skip to content

Commit

Permalink
[ncdirect] postition cursor after blitting image #2059
Browse files Browse the repository at this point in the history
  • Loading branch information
dankamongmen committed Sep 3, 2021
1 parent 569f0f3 commit 34869d3
Showing 1 changed file with 8 additions and 2 deletions.
10 changes: 8 additions & 2 deletions src/lib/direct.c
Original file line number Diff line number Diff line change
Expand Up @@ -525,12 +525,11 @@ ncdirect_dump_plane(ncdirect* n, const ncplane* np, int xoff){
if(fbuf_init(&f)){
return -1;
}
// FIXME figure out how tall it is, and ensure we have sufficient room via scrolling
if(cursor_yx_get(n->tcache.ttyfd, u7, &y, NULL)){
return -1;
}
if(toty - dimy < y){
int scrolls = y;
int scrolls = y - 1;
y = toty - dimy;
if(y < 0){
y = 0;
Expand Down Expand Up @@ -568,6 +567,13 @@ ncdirect_dump_plane(ncdirect* n, const ncplane* np, int xoff){
return -1;
}
}
int targy = y + dimy;
if(targy > toty){
targy = toty;
}
if(ncdirect_cursor_move_yx(n, targy, xoff)){
return -1;
}
return 0;
}
//fprintf(stderr, "rasterizing %dx%d+%d\n", dimy, dimx, xoff);
Expand Down

0 comments on commit 34869d3

Please sign in to comment.