Skip to content

Commit

Permalink
PicoVector: Fix bug in Polygon.rectangle.
Browse files Browse the repository at this point in the history
Fix spurious point in top-left corner causing a broken triangular
rectangle when any permutation of corners other than the bottom-left
is rounded.
  • Loading branch information
Gadgetoid committed Dec 6, 2024
1 parent d0903ca commit a75aea8
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion libraries/pico_vector/pretty-poly-primitives.h
Original file line number Diff line number Diff line change
Expand Up @@ -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) {
Expand Down

0 comments on commit a75aea8

Please sign in to comment.