Skip to content

Commit

Permalink
Fixed radius calculation for rounded rectangles
Browse files Browse the repository at this point in the history
  • Loading branch information
Grumbel committed Jul 30, 2014
1 parent bd6237d commit 0dd6287
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion src/video/sdl/sdl_renderer.cpp
Expand Up @@ -503,7 +503,8 @@ SDLRenderer::draw_filled_rect(const DrawingRequest& request)
Uint8 b = static_cast<Uint8>(fillrectrequest->color.blue * 255);
Uint8 a = static_cast<Uint8>(fillrectrequest->color.alpha * 255);

int radius = std::min(rect.h / 2, static_cast<int>(fillrectrequest->radius));
int radius = std::min(std::min(rect.h / 2, rect.w / 2),
static_cast<int>(fillrectrequest->radius));

if (radius)
{
Expand Down

0 comments on commit 0dd6287

Please sign in to comment.