boxdemo: rotate colors through at finer granularity #1186

pull/1190/head
nick black 4 years ago
parent b3b700a8c0
commit 8fe3e17b54
No known key found for this signature in database
GPG Key ID: 5F43400C21CBFACC

@ -2,25 +2,24 @@
#include <unistd.h>
#include "demo.h"
// FIXME smooth out this movement more
static int
reload_corners(struct ncplane* n, cell* ul, cell* ur, cell* ll, cell* lr){
int dimy, dimx;
ncplane_dim_yx(n, &dimy, &dimx);
char* egc;
if( (egc = ncplane_at_yx(n, 1, dimx - 1, NULL, &ul->channels)) == NULL){
if( (egc = ncplane_at_yx(n, 1, dimx - 2, NULL, &ur->channels)) == NULL){
return -1;
}
free(egc);
if( (egc = ncplane_at_yx(n, dimy - 1, dimx - 1, NULL, &ur->channels)) == NULL){
if( (egc = ncplane_at_yx(n, 2, 0, NULL, &ul->channels)) == NULL){
return -1;
}
free(egc);
if( (egc = ncplane_at_yx(n, dimy - 1, 0, NULL, &lr->channels)) == NULL){
if( (egc = ncplane_at_yx(n, dimy - 2, dimx - 1, NULL, &lr->channels)) == NULL){
return -1;
}
free(egc);
if( (egc = ncplane_at_yx(n, 1, 0, NULL, &ll->channels)) == NULL){
if( (egc = ncplane_at_yx(n, dimy - 1, 1, NULL, &ll->channels)) == NULL){
return -1;
}
free(egc);

Loading…
Cancel
Save