Explorar o código

Potentially better calculation for the default number of points in the rounded-rect variant of love.graphics.rectangle.

Alex Szpakowski %!s(int64=10) %!d(string=hai) anos
pai
achega
f334a24f79
Modificáronse 1 ficheiros con 1 adicións e 1 borrados
  1. 1 1
      src/modules/graphics/opengl/wrap_Graphics.cpp

+ 1 - 1
src/modules/graphics/opengl/wrap_Graphics.cpp

@@ -1542,7 +1542,7 @@ int w_rectangle(lua_State *L)
 
 
 	int points;
 	int points;
 	if (lua_isnoneornil(L, 8))
 	if (lua_isnoneornil(L, 8))
-		points = rx + ry > 20 ? (int)((rx + ry) / 4) : 10;
+		points = std::max(rx, ry) > 20.0 ? (int)(std::max(rx, ry) / 2) : 10;
 	else
 	else
 		points = luaL_checkint(L, 8);
 		points = luaL_checkint(L, 8);