From a2c48a8f448a128051f077f7a96c296adff8cba0 Mon Sep 17 00:00:00 2001 From: Phil Howard Date: Tue, 26 Nov 2024 11:12:24 +0000 Subject: [PATCH] PicoVector: Tweak for C++ compatibility. --- libraries/pico_vector/pretty-poly-primitives.h | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/libraries/pico_vector/pretty-poly-primitives.h b/libraries/pico_vector/pretty-poly-primitives.h index 196b054d1..0c081a9ac 100644 --- a/libraries/pico_vector/pretty-poly-primitives.h +++ b/libraries/pico_vector/pretty-poly-primitives.h @@ -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; }