Skip to content

Commit

Permalink
Bugfix for plugdata
Browse files Browse the repository at this point in the history
  • Loading branch information
timothyschoen committed Apr 30, 2024
1 parent 59ec850 commit 747d4b9
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions pdlua_gfx.h
Original file line number Diff line number Diff line change
Expand Up @@ -465,8 +465,8 @@ static int stroke_path(lua_State* L) {

for (int i = 0; i < path->num_path_segments; i++) {
float x = path->path_segments[i * 2], y = path->path_segments[i * 2 + 1];
SETFLOAT(coordinates + (path->num_path_segments * 2) + 1, x);
SETFLOAT(coordinates + (path->num_path_segments * 2) + 2, y);
SETFLOAT(coordinates + (i * 2) + 1, x);
SETFLOAT(coordinates + (i * 2) + 2, y);
}

plugdata_draw(gfx->object, gensym("lua_stroke_path"), path->num_path_segments * 2 + 1, coordinates);
Expand All @@ -487,8 +487,8 @@ static int fill_path(lua_State* L) {

for (int i = 0; i < path->num_path_segments; i++) {
float x = path->path_segments[i * 2], y = path->path_segments[i * 2 + 1];
SETFLOAT(coordinates + (path->num_path_segments * 2), x);
SETFLOAT(coordinates + (path->num_path_segments * 2) + 1, y);
SETFLOAT(coordinates + (i * 2), x);
SETFLOAT(coordinates + (i * 2) + 1, y);
}

plugdata_draw(gfx->object, gensym("lua_fill_path"), path->num_path_segments * 2, coordinates);
Expand Down

0 comments on commit 747d4b9

Please sign in to comment.