diff options
| author | Lucian Copeland <hierophect@gmail.com> | 2020-08-03 12:26:37 -0400 |
|---|---|---|
| committer | Lucian Copeland <hierophect@gmail.com> | 2020-08-03 12:26:37 -0400 |
| commit | 490066877878a7917ec99742a13a7687785ef614 (patch) | |
| tree | 101e39c7d66bb40db89f691f3780ac6466b97de1 /shared-module/vectorio | |
| parent | 94b2561860d92881e45b252e09cda5f5edaad090 (diff) | |
| parent | 034b1bb9035d60f6e0aa862f3bc60aafb1fd6e07 (diff) | |
Merge remote-tracking branch 'upstream/main' into esp32-neopixel
Diffstat (limited to 'shared-module/vectorio')
| -rw-r--r-- | shared-module/vectorio/Polygon.c | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/shared-module/vectorio/Polygon.c b/shared-module/vectorio/Polygon.c index c44c13fd7..e00a4696b 100644 --- a/shared-module/vectorio/Polygon.c +++ b/shared-module/vectorio/Polygon.c @@ -143,13 +143,13 @@ uint32_t common_hal_vectorio_polygon_get_pixel(void *obj, int16_t x, int16_t y) int y2 = self->points_list[i % self->len]; VECTORIO_POLYGON_DEBUG(" (%3d, %3d)}\n", x2, y2); if ( y1 <= y ) { - if ( y2 > y && line_side(x1, y1, x2, y2, x, y) > 0 ) { - // 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 ++winding_number; VECTORIO_POLYGON_DEBUG(" wind:%2d winding_number:%2d\n", 1, winding_number); } - } else if ( y2 <= y && line_side(x1, y1, x2, y2, x, y) < 0 ) { - // 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 --winding_number; VECTORIO_POLYGON_DEBUG(" wind:%2d winding_number:%2d\n", -1, winding_number); } |
