ncplane_move_yx: don't invoke sprixel_move on no movement

pull/1610/head
nick black 3 years ago committed by Nick Black
parent 069084d435
commit 7f1310f4d1

@ -1966,12 +1966,14 @@ int ncplane_move_yx(ncplane* n, int y, int x){
int dy, dx; // amount moved
dy = (n->boundto->absy + y) - n->absy;
dx = (n->boundto->absx + x) - n->absx;
if(n->sprite){
sprixel_movefrom(n->sprite, n->absy, n->absx);
if(dy || dx){ // don't want to trigger sprixel_movefrom() if unneeded
if(n->sprite){
sprixel_movefrom(n->sprite, n->absy, n->absx);
}
n->absx += dx;
n->absy += dy;
move_bound_planes(n->blist, dy, dx);
}
n->absx += dx;
n->absy += dy;
move_bound_planes(n->blist, dy, dx);
return 0;
}

Loading…
Cancel
Save