8000
We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
2 parents fbc7897 + 4c2d0c3 commit 5cb7e64Copy full SHA for 5cb7e64
shared-module/vectorio/Polygon.c
@@ -143,13 +143,13 @@ uint32_t common_hal_vectorio_polygon_g 9DD0 et_pixel(void *obj, int16_t x, int16_t y)
143
int y2 = self->points_list[i % self->len];
144
VECTORIO_POLYGON_DEBUG(" (%3d, %3d)}\n", x2, y2);
145
if ( y1 <= y ) {
146
- if ( y2 > y && line_side(x1, y1, x2, y2, x, y) > 0 ) {
147
- // Wind up, point is to the right of the edge vector
+ if ( y2 > y && line_side(x1, y1, x2, y2, x, y) < 0 ) {
+ // Wind up, point is to the left of the edge vector
148
++winding_number;
149
VECTORIO_POLYGON_DEBUG(" wind:%2d winding_number:%2d\n", 1, winding_number);
150
}
151
- } else if ( y2 <= y && line_side(x1, y1, x2, y2, x, y) < 0 ) {
152
- // Wind down, point is to the left of the edge vector
+ } else if ( y2 <= y && line_side(x1, y1, x2, y2, x, y) > 0 ) {
+ // Wind down, point is to the right of the edge vector
153
--winding_number;
154
VECTORIO_POLYGON_DEBUG(" wind:%2d winding_number:%2d\n", -1, winding_number);
155
0 commit comments