Review fixes

This commit is contained in:
cepprice 2021-04-05 19:56:03 +05:00
parent 0604374475
commit 7fd107c97a
3 changed files with 10 additions and 16 deletions

View file

@ -1119,21 +1119,17 @@ public class MeasurementEditingContext implements IRouteSettingsListener {
return true;
}
Set<String> profiles = new HashSet<>();
List<TrkSegment> 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

View file

@ -190,9 +190,7 @@ public abstract class GeometryWay<T extends GeometryWayContext, D extends Geomet
prevLon = lastProjection.getLongitude();
}
if (!Double.isNaN(prevLat) && !Double.isNaN(prevLon)) {
GeometryWayStyle<?> 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);

View file

@ -21,7 +21,7 @@ public class MultiProfileGeometryWayDrawer extends GeometryWayDrawer<MultiProfil
@Override
public void drawPath(Canvas canvas, Path path, GeometryWayStyle<?> style) {
if (style instanceof GeometryMultiProfileWayStyle) {
if (style instanceof GeometryMultiProfileWayStyle && !((GeometryMultiProfileWayStyle) style).isGap()) {
RenderingLineAttributes attrs = getContext().getAttrs();
attrs.paint.setColor(((GeometryMultiProfileWayStyle) style).getBorderColor());