mirror of
https://github.com/love2d/love.git
synced 2026-08-18 03:34:23 +02:00
Cleaned up some code, the 'ry' parameter of love.graphics.rectangle now defaults to the value of 'rx' rather than defaulting to 0.
This commit is contained in:
@@ -98,14 +98,14 @@ int w_BezierCurve_removeControlPoint(lua_State *L)
|
||||
{
|
||||
BezierCurve *curve = luax_checkbeziercurve(L, 1);
|
||||
int idx = luaL_checkint(L, 2);
|
||||
|
||||
|
||||
if (idx > 0) // 1-indexing
|
||||
idx--;
|
||||
|
||||
|
||||
luax_catchexcept(L, [&](){ curve->removeControlPoint(idx); });
|
||||
return 0;
|
||||
}
|
||||
|
||||
|
||||
int w_BezierCurve_getControlPointCount(lua_State *L)
|
||||
{
|
||||
BezierCurve *curve = luax_checkbeziercurve(L, 1);
|
||||
@@ -197,10 +197,10 @@ int w_BezierCurve_renderSegment(lua_State *L)
|
||||
double start = luaL_checknumber(L, 2);
|
||||
double end = luaL_checknumber(L, 3);
|
||||
int accuracy = luaL_optinteger(L, 4, 5);
|
||||
|
||||
|
||||
std::vector<Vector> points;
|
||||
luax_catchexcept(L, [&](){ points = curve->renderSegment(start, end, accuracy); });
|
||||
|
||||
|
||||
lua_createtable(L, points.size()*2, 0);
|
||||
for (size_t i = 0; i < points.size(); ++i)
|
||||
{
|
||||
@@ -209,10 +209,10 @@ int w_BezierCurve_renderSegment(lua_State *L)
|
||||
lua_pushnumber(L, points[i].y);
|
||||
lua_rawseti(L, -2, 2*i+2);
|
||||
}
|
||||
|
||||
|
||||
return 1;
|
||||
}
|
||||
|
||||
|
||||
static const luaL_Reg functions[] =
|
||||
{
|
||||
{"getDegree", w_BezierCurve_getDegree},
|
||||
|
||||
Reference in New Issue
Block a user