From 44279a48dd64fee78aaafda846b420d17ebc3ebb Mon Sep 17 00:00:00 2001 From: Henri Vasserman Date: Mon, 30 Dec 2024 12:20:00 +0200 Subject: [PATCH] fix boundary conditions --- field.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/field.c b/field.c index c7169ea..2d6e37c 100644 --- a/field.c +++ b/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);