From 3e6733d53863fd24810315f3178b3ae08d637814 Mon Sep 17 00:00:00 2001 From: Victor Shcherb Date: Fri, 1 May 2020 17:41:39 +0200 Subject: [PATCH] Fix issue #8835 --- .../java/net/osmand/util/MapAlgorithms.java | 17 +++++++++++++---- 1 file changed, 13 insertions(+), 4 deletions(-) diff --git a/OsmAnd-java/src/main/java/net/osmand/util/MapAlgorithms.java b/OsmAnd-java/src/main/java/net/osmand/util/MapAlgorithms.java index 23307babc9..e423e30860 100644 --- a/OsmAnd-java/src/main/java/net/osmand/util/MapAlgorithms.java +++ b/OsmAnd-java/src/main/java/net/osmand/util/MapAlgorithms.java @@ -182,11 +182,20 @@ public class MapAlgorithms { } } + if (outx == rightX || outx == leftX) { + if (outy >= topY && outy <= bottomY) { + bx = outx; + by = outy; + return combine2Points(bx, by); + } + } - if (outx == rightX || outx == leftX || outy == topY || outy == bottomY) { - bx = outx; - by = outy; - //return (((long) bx) << 32) | ((long) by); + if (outy == topY || outy == bottomY) { + if (leftX <= outx && outx <= rightX) { + bx = outx; + by = outy; + return combine2Points(bx, by); + } } return -1L; }