|
@@ -344,15 +344,9 @@ int sel_by_bbox(struct Map_info *Map,
|
|
|
struct bound_box bbox;
|
|
|
|
|
|
struct boxlist *List_tmp;
|
|
|
-
|
|
|
- if (first_selection) {
|
|
|
- List_tmp = List;
|
|
|
- first_selection = 0;
|
|
|
- }
|
|
|
- else {
|
|
|
- List_tmp = Vect_new_boxlist(0);
|
|
|
- }
|
|
|
-
|
|
|
+
|
|
|
+ List_tmp = Vect_new_boxlist(0);
|
|
|
+
|
|
|
/* bounding box */
|
|
|
bbox.N = y1 < y2 ? y2 : y1;
|
|
|
bbox.S = y1 < y2 ? y1 : y2;
|
|
@@ -360,17 +354,15 @@ int sel_by_bbox(struct Map_info *Map,
|
|
|
bbox.E = x1 < x2 ? x2 : x1;
|
|
|
bbox.T = PORT_DOUBLE_MAX;
|
|
|
bbox.B = -PORT_DOUBLE_MAX;
|
|
|
-
|
|
|
+
|
|
|
Vect_select_lines_by_box(Map, &bbox, type, List_tmp);
|
|
|
|
|
|
G_debug(1, " %d lines selected (by bbox)", List_tmp->n_values);
|
|
|
|
|
|
/* merge lists (only duplicate items) */
|
|
|
- if (List_tmp != List) {
|
|
|
- merge_lists2(List, List_tmp);
|
|
|
- Vect_destroy_boxlist(List_tmp);
|
|
|
- }
|
|
|
-
|
|
|
+ merge_lists2(List, List_tmp);
|
|
|
+ Vect_destroy_boxlist(List_tmp);
|
|
|
+
|
|
|
return List->n_values;
|
|
|
}
|
|
|
|