summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--uisimulator/sdl/lcd-sdl.c6
1 files changed, 3 insertions, 3 deletions
diff --git a/uisimulator/sdl/lcd-sdl.c b/uisimulator/sdl/lcd-sdl.c
index 4a0962dbec..3327dd8350 100644
--- a/uisimulator/sdl/lcd-sdl.c
+++ b/uisimulator/sdl/lcd-sdl.c
@@ -73,9 +73,9 @@ void sdl_set_gradient(SDL_Surface *surface, SDL_Color *start, SDL_Color *end, in
73 SDL_Color palette[steps]; 73 SDL_Color palette[steps];
74 74
75 for (i = 0; i < steps; i++) { 75 for (i = 0; i < steps; i++) {
76 palette[i].r = start->r + (end->r - start->r) * i / steps; 76 palette[i].r = start->r + (end->r - start->r) * i / (steps - 1);
77 palette[i].g = start->g + (end->g - start->g) * i / steps; 77 palette[i].g = start->g + (end->g - start->g) * i / (steps - 1);
78 palette[i].b = start->b + (end->b - start->b) * i / steps; 78 palette[i].b = start->b + (end->b - start->b) * i / (steps - 1);
79 } 79 }
80 80
81 SDL_SetPalette(surface, SDL_LOGPAL|SDL_PHYSPAL, palette, 0, steps); 81 SDL_SetPalette(surface, SDL_LOGPAL|SDL_PHYSPAL, palette, 0, steps);