mirror of
https://github.com/dankamongmen/notcurses.git
synced 2024-11-18 03:25:55 +00:00
adjust ncplane_yx() for margins
This commit is contained in:
parent
c056a0a026
commit
d5d827f38e
@ -99,6 +99,7 @@ int intro(struct notcurses* nc){
|
|||||||
return -1;
|
return -1;
|
||||||
}
|
}
|
||||||
ncplane_styles_off(ncp, NCSTYLE_ITALIC);
|
ncplane_styles_off(ncp, NCSTYLE_ITALIC);
|
||||||
|
// FIXME don't blow away the background color from the gradient. make this a transplane
|
||||||
ncplane_set_fg_rgb(ncp, 0xff, 0xff, 0xff);
|
ncplane_set_fg_rgb(ncp, 0xff, 0xff, 0xff);
|
||||||
if(ncplane_printf_aligned(ncp, rows - 5, NCALIGN_CENTER, "notcurses %s. press 'q' to quit.", notcurses_version()) < 0){
|
if(ncplane_printf_aligned(ncp, rows - 5, NCALIGN_CENTER, "notcurses %s. press 'q' to quit.", notcurses_version()) < 0){
|
||||||
return -1;
|
return -1;
|
||||||
|
@ -1814,17 +1814,17 @@ int ncplane_move_yx(ncplane* n, int y, int x){
|
|||||||
if(n == n->nc->stdscr){
|
if(n == n->nc->stdscr){
|
||||||
return -1;
|
return -1;
|
||||||
}
|
}
|
||||||
n->absy = y;
|
n->absy = y + n->nc->stdscr->absy;
|
||||||
n->absx = x;
|
n->absx = x + n->nc->stdscr->absx;
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
void ncplane_yx(const ncplane* n, int* y, int* x){
|
void ncplane_yx(const ncplane* n, int* y, int* x){
|
||||||
if(y){
|
if(y){
|
||||||
*y = n->absy;
|
*y = n->absy - n->nc->stdscr->absy;
|
||||||
}
|
}
|
||||||
if(x){
|
if(x){
|
||||||
*x = n->absx;
|
*x = n->absx - n->nc->stdscr->absx;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user