mirror of
https://github.com/love2d/love.git
synced 2026-08-15 15:51:12 +02:00
Rounded rectangles with radius values >= the rectangle's width and height are now clamped rather than causing an error.
This commit is contained in:
@@ -1137,6 +1137,13 @@ void Graphics::rectangle(DrawMode mode, float x, float y, float w, float h, floa
|
||||
return;
|
||||
}
|
||||
|
||||
// Radius values that are more than half the rectangle's size aren't handled
|
||||
// correctly (for now)...
|
||||
if (w >= 0.02f)
|
||||
rx = std::min(rx, w / 2.0f - 0.01f);
|
||||
if (h >= 0.02f)
|
||||
ry = std::min(ry, h / 2.0f - 0.01f);
|
||||
|
||||
points = std::max(points, 1);
|
||||
|
||||
const float half_pi = static_cast<float>(LOVE_M_PI / 2);
|
||||
|
||||
Reference in New Issue
Block a user