From 64fad214f3b7e6a0c69d164a6ad96e1659e7d19a Mon Sep 17 00:00:00 2001 From: PavelRatushny Date: Mon, 26 Jun 2017 19:09:09 +0300 Subject: [PATCH] Fix opening split segments in analyze on map --- OsmAnd/src/net/osmand/plus/views/GPXLayer.java | 18 ++++++++++-------- 1 file changed, 10 insertions(+), 8 deletions(-) diff --git a/OsmAnd/src/net/osmand/plus/views/GPXLayer.java b/OsmAnd/src/net/osmand/plus/views/GPXLayer.java index 0e588b0b9e..0a267ee154 100644 --- a/OsmAnd/src/net/osmand/plus/views/GPXLayer.java +++ b/OsmAnd/src/net/osmand/plus/views/GPXLayer.java @@ -426,14 +426,16 @@ public class GPXLayer extends OsmandMapLayer implements ContextMenuLayer.IContex float r = 3 * tileBox.getDensity(); for (int i = 0; i < xAxisPoints.size(); i++) { WptPt axisPoint = xAxisPoints.get(i); - if (axisPoint.getLatitude() >= latLonBounds.bottom - && axisPoint.getLatitude() <= latLonBounds.top - && axisPoint.getLongitude() >= latLonBounds.left - && axisPoint.getLongitude() <= latLonBounds.right) { - float x = tileBox.getPixXFromLatLon(axisPoint.getLatitude(), axisPoint.getLongitude()); - float y = tileBox.getPixYFromLatLon(axisPoint.getLatitude(), axisPoint.getLongitude()); - canvas.drawCircle(x, y, r + 2 * (float) Math.ceil(tileBox.getDensity()), paintGridOuterCircle); - canvas.drawCircle(x, y, r + (float) Math.ceil(tileBox.getDensity()), paintGridCircle); + if (axisPoint != null) { + if (axisPoint.getLatitude() >= latLonBounds.bottom + && axisPoint.getLatitude() <= latLonBounds.top + && axisPoint.getLongitude() >= latLonBounds.left + && axisPoint.getLongitude() <= latLonBounds.right) { + float x = tileBox.getPixXFromLatLon(axisPoint.getLatitude(), axisPoint.getLongitude()); + float y = tileBox.getPixYFromLatLon(axisPoint.getLatitude(), axisPoint.getLongitude()); + canvas.drawCircle(x, y, r + 2 * (float) Math.ceil(tileBox.getDensity()), paintGridOuterCircle); + canvas.drawCircle(x, y, r + (float) Math.ceil(tileBox.getDensity()), paintGridCircle); + } } } }