[GRASS-SVN] r33199 - grass/trunk/gui/wxpython/vdigit

svn_grass at osgeo.org svn_grass at osgeo.org
Mon Sep 1 12:49:12 EDT 2008


Author: martinl
Date: 2008-09-01 12:49:11 -0400 (Mon, 01 Sep 2008)
New Revision: 33199

Modified:
   grass/trunk/gui/wxpython/vdigit/driver_select.cpp
Log:
wxGUI/vdigit: bug fix in GetRegionSelected()
(merge from devbr6, r33197, r33198)


Modified: grass/trunk/gui/wxpython/vdigit/driver_select.cpp
===================================================================
--- grass/trunk/gui/wxpython/vdigit/driver_select.cpp	2008-09-01 16:47:44 UTC (rev 33198)
+++ grass/trunk/gui/wxpython/vdigit/driver_select.cpp	2008-09-01 16:49:11 UTC (rev 33199)
@@ -415,7 +415,7 @@
 */
 std::vector<int> DisplayDriver::GetRegionSelected()
 {
-    int line, area;
+    int line, area, nareas;
     
     std::vector<int> region;
 
@@ -437,7 +437,7 @@
 	*/
 	int type;
 	bool found;
-	for (int line = 1; line < Vect_get_num_lines(mapInfo); line++) {
+	for (int line = 1; line <= Vect_get_num_lines(mapInfo); line++) {
 	    type = Vect_read_line (mapInfo, NULL, cats, line);
 	    if (!(type & (GV_POINTS | GV_LINES)))
 		continue;
@@ -457,11 +457,12 @@
 	list = selected.values;
     }
 
+    nareas = Vect_get_num_areas(mapInfo);
     for (int i = 0; i < list->n_values; i++) {
 	line = list->value[i];
 	area = Vect_get_centroid_area(mapInfo, line);
 
-	if (area > 0) {
+	if (area > 0 && area <= nareas) {
 	    if (!Vect_get_area_box(mapInfo, area, &line_box))
 		continue;
 	}



More information about the grass-commit mailing list