adapt callers of ncvisual_geom()

pull/710/head
nick black 4 years ago
parent 70183ee283
commit 3936d1b528
No known key found for this signature in database
GPG Key ID: 5F43400C21CBFACC

@ -212,7 +212,7 @@ int luigi_demo(struct notcurses* nc){
}
ncplane_move_yx(lastseen, yoff, i);
int dimy, scaley;
ncvisual_geom(nc, wmncv, NCBLIT_DEFAULT, &dimy, NULL, &scaley, NULL);
ncvisual_geom(nc, wmncv, NULL, &dimy, NULL, &scaley, NULL);
dimy /= scaley;
ncplane_move_yx(wmplane, rows * 4 / 5 - dimy + 1 + (i % 2), i - 60);
DEMO_RENDER(nc);

@ -84,7 +84,7 @@ rotate_visual(struct notcurses* nc, struct ncplane* n, int dy, int dx){
break;
}
int vy, vx, vyscale, vxscale;
ncvisual_geom(nc, ncv, NCBLIT_DEFAULT, &vy, &vx, &vyscale, &vxscale);
ncvisual_geom(nc, ncv, &vopts, &vy, &vx, &vyscale, &vxscale);
vopts.x = (dimx - (vx / vxscale)) / 2;
vopts.y = (dimy - (vy / vyscale)) / 2;
struct ncplane* newn;

@ -68,7 +68,7 @@ rotate_grad(struct notcurses* nc){
if(NCERR_SUCCESS != ncvisual_rotate(v, M_PI / 2)){
return -1;
}
ncvisual_geom(nc, v, NCBLIT_DEFAULT, &vy, &vx, &scaley, &scalex);
ncvisual_geom(nc, v, &vopts, &vy, &vx, &scaley, &scalex);
vopts.x = (dimx - (vx / scalex)) / 2;
vopts.y = (dimy - (vy / scaley)) / 2;
struct ncplane* newn = ncvisual_render(nc, v, &vopts);
@ -82,7 +82,7 @@ rotate_grad(struct notcurses* nc){
for(int i = 0 ; i < 8 ; ++i){
int vy, vx, scaley, scalex;
ncvisual_geom(nc, v, NCBLIT_DEFAULT, &vy, &vx, &scaley, &scalex);
ncvisual_geom(nc, v, &vopts, &vy, &vx, &scaley, &scalex);
vopts.x = (dimx - (vx / scalex)) / 2;
vopts.y = (dimy - (vy / scaley)) / 2;
if(NCERR_SUCCESS != ncvisual_rotate(v, M_PI / 4)){

@ -580,6 +580,7 @@ TEST_CASE("Wide") {
REQUIRE(nullptr != topp);
CHECK(0 == ncplane_set_bg_rgb(topp, 0, 0xff, 0));
CHECK(6 == ncplane_putstr(topp, "次次"));
CHECK(0 == ncplane_cursor_move_yx(n_, 0, 0));
CHECK(12 == ncplane_putstr(n_, "六六六六"));
CHECK(0 == notcurses_render(nc_));
uint32_t attrword;

Loading…
Cancel
Save