small fix to display

This commit is contained in:
Alexandre 2024-08-21 16:32:22 +02:00
parent 6383d92730
commit b1b77a6895
2 changed files with 2 additions and 2 deletions

Binary file not shown.

View File

@ -144,7 +144,7 @@ long cell_colors(cell* cl) {
} }
void draw_cell(SDL_Renderer* renderer, int xmin, int xmax, int ymin, int ymax, cell* cl, int draw_id) { void draw_cell(SDL_Renderer* renderer, int xmin, int xmax, int ymin, int ymax, cell* cl, int draw_id) {
if(cl != NULL && cl->id != draw_id && cl->coord_x - tile_size > xmin && cl->coord_x - tile_size < xmax && cl->coord_y > ymin && cl->coord_y < ymax) { if(cl != NULL && cl->id != draw_id && (cl->coord_x - tile_size > xmin || cl->coord_x - tile_size < xmax || cl->coord_y > ymin || cl->coord_y < ymax)) {
// draw lines // draw lines
cl->id = draw_id; cl->id = draw_id;
int nxmin = to_int((to_double(cl->coord_x) - to_double(xmin)) * to_double(__width__)) / (to_double(xmax) - to_double(xmin)) ; int nxmin = to_int((to_double(cl->coord_x) - to_double(xmin)) * to_double(__width__)) / (to_double(xmax) - to_double(xmin)) ;