From: Ingo Ruhnke Date: Tue, 12 Aug 2014 23:20:00 +0000 (+0200) Subject: Fixed SDL gradient renderer not drawing anything if top and bottom colors are the... X-Git-Url: https://git.verplant.org/?a=commitdiff_plain;h=2d234652fddc910bb6b2abf0b75474750440c5f9;p=supertux.git Fixed SDL gradient renderer not drawing anything if top and bottom colors are the same Problem could be seen in "data/levels/world1/19 - Miyamoto Monument.stl" --- diff --git a/src/video/sdl/sdl_painter.cpp b/src/video/sdl/sdl_painter.cpp index 8074d2f0c..25b884393 100644 --- a/src/video/sdl/sdl_painter.cpp +++ b/src/video/sdl/sdl_painter.cpp @@ -145,6 +145,7 @@ SDLPainter::draw_gradient(SDL_Renderer* renderer, const DrawingRequest& request) fabsf(top.green - bottom.green)), std::max(fabsf(top.blue - bottom.blue), fabsf(top.alpha - bottom.alpha))) * 255); + n = std::max(n, 1); for(int i = 0; i < n; ++i) { SDL_Rect rect;