fix boundary conditions
parent
a659854c41
commit
44279a48dd
4
field.c
4
field.c
|
@ -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);
|
||||
|
|
Loading…
Reference in New Issue