diff options
author | Birte Kristina Friesel <derf@finalrewind.org> | 2025-05-30 12:32:59 +0200 |
---|---|---|
committer | Birte Kristina Friesel <derf@finalrewind.org> | 2025-05-30 12:32:59 +0200 |
commit | e9f26a6aab98d7054bd8abd4b6bceba05c54baee (patch) | |
tree | bcdc05a3fdd5a06440f1fdacf5ced68b48d64e53 | |
parent | a985b8cd1d7f1b73189a1f63f25d2c4aa5d1f04a (diff) |
polyline_to_map: handle cases where from and to are in inverse order2.12.1
-rwxr-xr-x | lib/Travelynx.pm | 3 |
1 files changed, 3 insertions, 0 deletions
diff --git a/lib/Travelynx.pm b/lib/Travelynx.pm index f9723c1..efe5c07 100755 --- a/lib/Travelynx.pm +++ b/lib/Travelynx.pm @@ -2410,6 +2410,9 @@ sub startup { . ( $to_index - $from_index ); $seen{$key} = 1; + if ( $from_index > $to_index ) { + ( $to_index, $from_index ) = ( $from_index, $to_index ); + } @polyline = @polyline[ $from_index .. $to_index ]; my @polyline_coords; for my $coord (@polyline) { |