commit de935acde2201476e27e25cd1b655e3d2553f62a
parent b8ebe5c792fc78fa8fb3a4e7be0c07d4b3ea9c57
Author: Christophe Coustet <christophe.coustet@meso-star.com>
Date: Tue, 18 Apr 2023 15:46:14 +0200
BugFix: use invalid counts if polygon was simplified
Diffstat:
1 file changed, 5 insertions(+), 5 deletions(-)
diff --git a/src/scpr_polygon.c b/src/scpr_polygon.c
@@ -242,13 +242,13 @@ scpr_polygon_setup_indexed_vertices
"Polygon has been simplified. Original counts are no longer valid.\n");
}
- /* Build bounding box */
+ /* Build bounding box (don't use ncomponents nor get_nverts just in case
+ * counts are no longer valid!) */
polygon->lower[0] = polygon->lower[1] = INT64_MAX;
polygon->upper[0] = polygon->upper[1] = INT64_MIN;
- FOR_EACH(c, 0, ncomponents) {
- size_t i, nverts;
- get_nverts(c, &nverts, data);
- FOR_EACH(i, 0, nverts) {
+ FOR_EACH(c, 0, polygon->paths.size()) {
+ size_t i;
+ FOR_EACH(i, 0, polygon->paths[c].size()) {
int64_t tmp[2];
int j;
tmp[0] = polygon->paths[c][i].x;