Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- Index: lines2curves.pl
- ===================================================================
- --- lines2curves.pl (revision 2621)
- +++ lines2curves.pl (working copy)
- @@ -288,18 +288,27 @@
- # smoothly - a point that Jochn Topf noticed.
- #
- my $start_point = $points_ref->[0][0].$points_ref->[0][1];
- + my $start_point2 = $points_ref->[1][0].$points_ref->[1][1];
- my $end_point = $points_ref->[-1][0].$points_ref->[-1][1];
- + my $end_point2 = $points_ref->[-2][0].$points_ref->[-2][1];
- + my $penultimate_point_ref;
- my $second_point_ref;
- if ($start_point eq $end_point && $way_id =~ /area_/) {
- - $second_point_ref = $points_ref->[-2];
- + $penultimate_point_ref = $points_ref->[-2];
- } else {
- - $second_point_ref = get_second_point($start_point, $way_id);
- + $penultimate_point_ref = get_second_point($start_point, $way_id);
- }
- - if ($second_point_ref && $second_point_ref->[0].$second_point_ref->[1] ne
- - $points_ref->[1][0].$points_ref->[1][1]) {
- - unshift @$points_ref, $second_point_ref;
- +
- + if ($start_point eq $end_point && $way_id =~ /area_/) {
- + $second_point_ref = $points_ref->[1];
- + } else {
- + $second_point_ref = get_second_point($end_point, $way_id);
- + }
- +
- + if ($penultimate_point_ref && $penultimate_point_ref->[0].$penultimate_point_ref->[1] ne $start_point2) {
- + unshift @$points_ref, $penultimate_point_ref;
- } else { # make a dummy point
- unshift @$points_ref, [ $points_ref->[0][0]
- -$points_ref->[1][0] + $points_ref->[0][0],
- @@ -307,13 +316,7 @@
- -$points_ref->[1][1] + $points_ref->[0][1] ];
- }
- - if ($start_point eq $end_point && $way_id =~ /area_/) {
- - $second_point_ref = $points_ref->[1];
- - } else {
- - $second_point_ref = get_second_point($end_point, $way_id);
- - }
- - if ($second_point_ref && $second_point_ref->[0].$second_point_ref->[1] ne
- - $points_ref->[-2][0].$points_ref->[-2][1]) {
- + if ($second_point_ref && $second_point_ref->[0].$second_point_ref->[1] ne $end_point2) {
- push @$points_ref, $second_point_ref;
- } else { # make a dummy point
- push @$points_ref, [ $points_ref->[-1][0]
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement