From e9f26a6aab98d7054bd8abd4b6bceba05c54baee Mon Sep 17 00:00:00 2001 From: Birte Kristina Friesel Date: Fri, 30 May 2025 12:32:59 +0200 Subject: polyline_to_map: handle cases where from and to are in inverse order --- lib/Travelynx.pm | 3 +++ 1 file changed, 3 insertions(+) (limited to 'lib/Travelynx.pm') 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) { -- cgit v1.2.3