Selaa lähdekoodia

d.vect: skip isles asap

git-svn-id: https://svn.osgeo.org/grass/grass/trunk@53626 15284696-431f-4ddb-bdfa-cd5b030d7da7
Markus Metz 12 vuotta sitten
vanhempi
commit
a915559349
1 muutettua tiedostoa jossa 6 lisäystä ja 3 poistoa
  1. 6 3
      display/d.vect/area.c

+ 6 - 3
display/d.vect/area.c

@@ -61,6 +61,11 @@ int display_area(struct Map_info *Map, struct cat_list *Clist, const struct Cell
 	if (!Vect_area_alive(Map, area))
 	    continue;
 
+	centroid = Vect_get_area_centroid(Map, area);
+	if (!centroid) {
+	    continue;
+	}
+
 	/* Check box */
 	Vect_get_area_box(Map, area, &box);
 	if (box.N < window->south || box.S > window->north ||
@@ -84,7 +89,6 @@ int display_area(struct Map_info *Map, struct cat_list *Clist, const struct Cell
 		    continue;
 	    }
 	    else {
-		centroid = Vect_get_area_centroid(Map, area);
 		G_debug(3, "centroid = %d", centroid);
 		if (centroid < 1)
 		    continue;
@@ -107,7 +111,6 @@ int display_area(struct Map_info *Map, struct cat_list *Clist, const struct Cell
 	}
 	else if (Clist->field > 0) {
 	    found = FALSE;
-	    centroid = Vect_get_area_centroid(Map, area);
 	    G_debug(3, "\tcentroid = %d", centroid);
 	    if (centroid < 1)
 		continue;
@@ -159,7 +162,7 @@ int display_area(struct Map_info *Map, struct cat_list *Clist, const struct Cell
 				(Clist->field > 0 ? Clist->field :
 				 (Cats->n_cats > 0 ? Cats->field[0] : 1)));
 
-	if (!Vect_get_area_centroid(Map, area) && cat == -1) {
+	if (cat == -1) {
 	    continue;
 	}