fix boundary conditions

main
Henri Vasserman 2024-12-30 12:20:00 +02:00
parent a659854c41
commit 44279a48dd
1 changed files with 2 additions and 2 deletions

View File

@ -35,7 +35,7 @@ void Field_scroll(Field *f, SDL_Renderer *rend) {
Picture_render(f->tl, rend);
Picture_render(f->bl, rend);
}
if (f->offset.y > f->br->y1) {
if (f->offset.y >= f->br->y1) {
SWAP(f->tl, f->bl);
SWAP(f->tr, f->br);
Picture_move(f->bl, 0, 2*h);
@ -43,7 +43,7 @@ void Field_scroll(Field *f, SDL_Renderer *rend) {
Picture_render(f->bl, rend);
Picture_render(f->br, rend);
}
if (f->offset.x > f->br->x1) {
if (f->offset.x >= f->br->x1) {
SWAP(f->tl, f->tr);
SWAP(f->bl, f->br);
Picture_move(f->tr, 2*w, 0);