From 0dd6287cb8d731c039ed803bf0b8c917f815f358 Mon Sep 17 00:00:00 2001 From: Ingo Ruhnke Date: Wed, 30 Jul 2014 18:58:52 +0200 Subject: [PATCH] Fixed radius calculation for rounded rectangles --- src/video/sdl/sdl_renderer.cpp | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) 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) { -- 2.11.0