~ubuntu-branches/ubuntu/precise/grass/precise

« back to all changes in this revision

Viewing changes to vector/v.digit/vertex.c

  • Committer: Bazaar Package Importer
  • Author(s): Francesco Paolo Lovergine
  • Date: 2011-04-13 17:08:41 UTC
  • mfrom: (8.1.7 sid)
  • Revision ID: james.westby@ubuntu.com-20110413170841-ss1t9bic0d0uq0gz
Tags: 6.4.1-1
* New upstream version.
* Now build-dep on libjpeg-dev and current libreadline6-dev.
* Removed patch swig: obsolete.
* Policy bumped to 3.9.2, without changes.

Show diffs side-by-side

added added

removed removed

Lines of Context:
243
243
 
244
244
            type = Vect_read_line(&Map, rv->Points, rv->Cats, rv->last_line);
245
245
            np = rv->Points->n_points;
246
 
            for (i = rv->last_seg; i < np - 1; i++) {
247
 
                rv->Points->x[i] = rv->Points->x[i + 1];
248
 
                rv->Points->y[i] = rv->Points->y[i + 1];
249
 
                rv->Points->z[i] = rv->Points->z[i + 1];
250
 
            }
251
 
            rv->Points->n_points--;
252
 
            Vect_rewrite_line(&Map, rv->last_line, type, rv->Points,
 
246
            
 
247
            /* Lines should have at least two vertices (start and end node). */
 
248
            if (np < 3 && Vect_line_alive(&Map, rv->last_line)) {
 
249
                Vect_delete_line(&Map, rv->last_line);
 
250
                for (i = 0; i < rv->Cats->n_cats; i++) {
 
251
                    check_record(rv->Cats->field[i], rv->Cats->cat[i]);
 
252
                }
 
253
            } else {
 
254
                for (i = rv->last_seg; i < np - 1; i++) {
 
255
                    rv->Points->x[i] = rv->Points->x[i + 1];
 
256
                    rv->Points->y[i] = rv->Points->y[i + 1];
 
257
                    rv->Points->z[i] = rv->Points->z[i + 1];
 
258
                }
 
259
                rv->Points->n_points--;
 
260
                Vect_rewrite_line(&Map, rv->last_line, type, rv->Points,
253
261
                              rv->Cats);
 
262
            }
254
263
            updated_lines_and_nodes_erase_refresh_display();
255
264
            rv->last_line = 0;
256
265
        }