diff --git a/OsmAnd/src/net/osmand/plus/measurementtool/MeasurementEditingContext.java b/OsmAnd/src/net/osmand/plus/measurementtool/MeasurementEditingContext.java index ba28e9402a..af4d599afa 100644 --- a/OsmAnd/src/net/osmand/plus/measurementtool/MeasurementEditingContext.java +++ b/OsmAnd/src/net/osmand/plus/measurementtool/MeasurementEditingContext.java @@ -1119,21 +1119,17 @@ public class MeasurementEditingContext implements IRouteSettingsListener { return true; } Set profiles = new HashSet<>(); - List segments = new ArrayList<>(); - segments.addAll(beforeSegments); - segments.addAll(afterSegments); - for (TrkSegment segment : segments) { - if (Algorithms.isEmpty(segment.points)) { - continue; - } - for (WptPt pt : segment.points) { - if (!pt.isGap()) { - profiles.add(pt.getProfileType()); + for (RoadSegmentData segmentData : roadSegmentData.values()) { + String profile = segmentData.getAppMode().getStringKey(); + if (!DEFAULT_APP_MODE.getStringKey().equals(profile)) { + profiles.add(profile); + if (profiles.size() >= 2) { + lastCalculationMode = NEXT_SEGMENT; + return true; } } } - lastCalculationMode = profiles.size() >= 2 ? NEXT_SEGMENT : WHOLE_TRACK; - return profiles.size() >= 2; + return false; } @Override diff --git a/OsmAnd/src/net/osmand/plus/views/layers/geometry/GeometryWay.java b/OsmAnd/src/net/osmand/plus/views/layers/geometry/GeometryWay.java index 2538103ec0..ab98990d36 100644 --- a/OsmAnd/src/net/osmand/plus/views/layers/geometry/GeometryWay.java +++ b/OsmAnd/src/net/osmand/plus/views/layers/geometry/GeometryWay.java @@ -190,9 +190,7 @@ public abstract class GeometryWay prevStyle = style instanceof GeometryMultiProfileWayStyle ? - getStyle(i - 1, style) : style; - addLocation(tb, prevLat, prevLon, prevStyle, tx, ty, angles, distances, dist, styles); // first point + addLocation(tb, prevLat, prevLon, getStyle(i - 1, style), tx, ty, angles, distances, dist, styles); // first point } } addLocation(tb, lat, lon, style, tx, ty, angles, distances, dist, styles); diff --git a/OsmAnd/src/net/osmand/plus/views/layers/geometry/MultiProfileGeometryWayDrawer.java b/OsmAnd/src/net/osmand/plus/views/layers/geometry/MultiProfileGeometryWayDrawer.java index b0c7e7c369..c9e5f8101f 100644 --- a/OsmAnd/src/net/osmand/plus/views/layers/geometry/MultiProfileGeometryWayDrawer.java +++ b/OsmAnd/src/net/osmand/plus/views/layers/geometry/MultiProfileGeometryWayDrawer.java @@ -21,7 +21,7 @@ public class MultiProfileGeometryWayDrawer extends GeometryWayDrawer style) { - if (style instanceof GeometryMultiProfileWayStyle) { + if (style instanceof GeometryMultiProfileWayStyle && !((GeometryMultiProfileWayStyle) style).isGap()) { RenderingLineAttributes attrs = getContext().getAttrs(); attrs.paint.setColor(((GeometryMultiProfileWayStyle) style).getBorderColor());