]> git.itanic.dy.fi Git - sdl-planets/commitdiff
draw_planet: Minimum size for a planet should be one pixel
authorTimo Kokkonen <kaapeli@itanic.dy.fi>
Sun, 7 Mar 2010 11:59:32 +0000 (13:59 +0200)
committerTimo Kokkonen <kaapeli@itanic.dy.fi>
Sun, 7 Mar 2010 11:59:32 +0000 (13:59 +0200)
Signed-off-by: Timo Kokkonen <kaapeli@itanic.dy.fi>
planet.c

index 73bde0fedcfd08756edd097bffec556458287c1e..c25a2860838d69b77fc53c7957761c7f370ee49d 100644 (file)
--- a/planet.c
+++ b/planet.c
@@ -44,8 +44,8 @@ void draw_planet(SDL_Surface *screen, struct planet *p)
        x_start = MAX(p->pos.x - size, 0);
        y = MAX(p->pos.y - size, 0);
 
-       x_end = MIN(p->pos.x + size, screen->w);
-       y_end = MIN(p->pos.y + size, screen->h);
+       x_end = MIN(p->pos.x + size + 1, screen->w);
+       y_end = MIN(p->pos.y + size + 1, screen->h);
 
        for (; y < y_end; y++)
                for (x = x_start; x < x_end; x++)