Skip to content
Permalink
Browse files

Curve:render always returns 2 points if it's a line;

  • Loading branch information
bjornbytes committed Jan 14, 2020
1 parent f728496 commit afa552377308d630543b210149d72f7945548bf5
Showing with 3 additions and 0 deletions.
  1. +3 −0 src/api/l_math_curve.c
@@ -30,6 +30,9 @@ static int l_lovrCurveRender(lua_State* L) {
int n = luaL_optinteger(L, 2, 32);
float t1 = luax_optfloat(L, 3, 0.);
float t2 = luax_optfloat(L, 4, 1.);
if (lovrCurveGetPointCount(curve) == 2) {
n = 2;
}
float* points = malloc(4 * n * sizeof(float));
lovrAssert(points, "Out of memory");
lovrCurveRender(curve, t1, t2, points, n);

0 comments on commit afa5523

Please sign in to comment.
You can’t perform that action at this time.