Skip to content

Commit

Permalink
PicoVector: Tweak for C++ compatibility.
Browse files Browse the repository at this point in the history
  • Loading branch information
Gadgetoid committed Nov 26, 2024
1 parent c1e0631 commit a2c48a8
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion libraries/pico_vector/pretty-poly-primitives.h
Original file line number Diff line number Diff line change
Expand Up @@ -216,7 +216,8 @@ pp_poly_t* ppp_line(ppp_line_def d) {
pp_point_t v = {d.y2 - d.y1, d.x2 - d.x1};
float mag = sqrt(v.x * v.x + v.y * v.y);
v.x /= mag; v.y /= mag; v.x *= -(d.s / 2.0f); v.y *= (d.s / 2.0f);
pp_path_add_points(path, (pp_point_t[]){{d.x1 + v.x, d.y1 + v.y}, {d.x2 + v.x, d.y2 + v.y}, {d.x2 - v.x, d.y2 - v.y}, {d.x1 - v.x, d.y1 - v.y}}, 4);
pp_point_t points[] = {{d.x1 + v.x, d.y1 + v.y}, {d.x2 + v.x, d.y2 + v.y}, {d.x2 - v.x, d.y2 - v.y}, {d.x1 - v.x, d.y1 - v.y}};
pp_path_add_points(path, points, 4);
return poly;
}

Expand Down

0 comments on commit a2c48a8

Please sign in to comment.