From a75aea818d51dd975b9ab23fb0da899fa437f327 Mon Sep 17 00:00:00 2001 From: Phil Howard <github@gadgetoid.com> Date: Fri, 6 Dec 2024 13:12:30 +0000 Subject: [PATCH] PicoVector: Fix bug in Polygon.rectangle. Fix spurious point in top-left corner causing a broken triangular rectangle when any permutation of corners other than the bottom-left is rounded. --- libraries/pico_vector/pretty-poly-primitives.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/libraries/pico_vector/pretty-poly-primitives.h b/libraries/pico_vector/pretty-poly-primitives.h index 0c081a9ac..aa633bbb4 100644 --- a/libraries/pico_vector/pretty-poly-primitives.h +++ b/libraries/pico_vector/pretty-poly-primitives.h @@ -115,7 +115,7 @@ void _ppp_rrect_path(pp_path_t *path, ppp_rect_def d) { d.r1 == 0 ? pp_path_add_point(path, (pp_point_t){d.x, d.y}) : _ppp_rrect_corner(path, d.x + d.r1, d.y + d.r1, d.r1, 3); d.r2 == 0 ? pp_path_add_point(path, (pp_point_t){d.x + d.w, d.y}) : _ppp_rrect_corner(path, d.x + d.w - d.r2, d.y + d.r2, d.r2, 2); d.r3 == 0 ? pp_path_add_point(path, (pp_point_t){d.x + d.w, d.y + d.h}) : _ppp_rrect_corner(path, d.x + d.w - d.r3, d.y + d.h - d.r3, d.r3, 1); - d.r4 == 0 ? pp_path_add_point(path, (pp_point_t){d.x, d.y}) : _ppp_rrect_corner(path, d.x + d.r4, d.y + d.h - d.r4, d.r4, 0); + d.r4 == 0 ? pp_path_add_point(path, (pp_point_t){d.x, d.y + d.h}) : _ppp_rrect_corner(path, d.x + d.r4, d.y + d.h - d.r4, d.r4, 0); } pp_poly_t* ppp_rect(ppp_rect_def d) {