Advertisement
Guest User

lines2curves.pl.diff

a guest
Jul 4th, 2011
66
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Diff 2.27 KB | None | 0 0
  1. Index: lines2curves.pl
  2. ===================================================================
  3. --- lines2curves.pl (revision 2621)
  4. +++ lines2curves.pl (working copy)
  5. @@ -288,18 +288,27 @@
  6.      # smoothly - a point that Jochn Topf noticed.
  7.      #
  8.      my $start_point = $points_ref->[0][0].$points_ref->[0][1];
  9. +    my $start_point2 = $points_ref->[1][0].$points_ref->[1][1];
  10.      my $end_point   = $points_ref->[-1][0].$points_ref->[-1][1];
  11. +    my $end_point2   = $points_ref->[-2][0].$points_ref->[-2][1];
  12.  
  13. +    my $penultimate_point_ref;
  14.      my $second_point_ref;
  15.      
  16.      if ($start_point eq $end_point && $way_id =~ /area_/) {
  17. -        $second_point_ref = $points_ref->[-2];
  18. +        $penultimate_point_ref = $points_ref->[-2];
  19.      } else {
  20. -        $second_point_ref = get_second_point($start_point, $way_id);
  21. +        $penultimate_point_ref = get_second_point($start_point, $way_id);
  22.      }
  23. -    if ($second_point_ref && $second_point_ref->[0].$second_point_ref->[1] ne
  24. -    $points_ref->[1][0].$points_ref->[1][1]) {
  25. -        unshift @$points_ref, $second_point_ref;
  26. +
  27. +    if ($start_point eq $end_point && $way_id =~ /area_/) {
  28. +        $second_point_ref = $points_ref->[1];
  29. +    } else {
  30. +        $second_point_ref = get_second_point($end_point, $way_id);
  31. +    }
  32. +
  33. +    if ($penultimate_point_ref && $penultimate_point_ref->[0].$penultimate_point_ref->[1] ne $start_point2) {
  34. +        unshift @$points_ref, $penultimate_point_ref;
  35.      } else { # make a dummy point
  36.          unshift @$points_ref, [ $points_ref->[0][0]
  37.                                 -$points_ref->[1][0] + $points_ref->[0][0],
  38. @@ -307,13 +316,7 @@
  39.                                 -$points_ref->[1][1] + $points_ref->[0][1] ];
  40.      }
  41.  
  42. -    if ($start_point eq $end_point && $way_id =~ /area_/) {
  43. -        $second_point_ref = $points_ref->[1];
  44. -    } else {
  45. -        $second_point_ref = get_second_point($end_point, $way_id);
  46. -    }
  47. -    if ($second_point_ref && $second_point_ref->[0].$second_point_ref->[1] ne
  48. -    $points_ref->[-2][0].$points_ref->[-2][1]) {
  49. +    if ($second_point_ref && $second_point_ref->[0].$second_point_ref->[1] ne $end_point2) {
  50.          push @$points_ref, $second_point_ref;
  51.      } else { # make a dummy point
  52.          push @$points_ref, [ $points_ref->[-1][0]
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement