From: Ingo Ruhnke Date: Wed, 30 Jul 2014 16:58:52 +0000 (+0200) Subject: Fixed radius calculation for rounded rectangles X-Git-Url: https://git.verplant.org/?a=commitdiff_plain;h=0dd6287cb8d731c039ed803bf0b8c917f815f358;p=supertux.git Fixed radius calculation for rounded rectangles --- diff --git a/src/video/sdl/sdl_renderer.cpp b/src/video/sdl/sdl_renderer.cpp index 38cd046d6..21951d633 100644 --- a/src/video/sdl/sdl_renderer.cpp +++ b/src/video/sdl/sdl_renderer.cpp @@ -503,7 +503,8 @@ SDLRenderer::draw_filled_rect(const DrawingRequest& request) Uint8 b = static_cast(fillrectrequest->color.blue * 255); Uint8 a = static_cast(fillrectrequest->color.alpha * 255); - int radius = std::min(rect.h / 2, static_cast(fillrectrequest->radius)); + int radius = std::min(std::min(rect.h / 2, rect.w / 2), + static_cast(fillrectrequest->radius)); if (radius) {