Merge pull request #4163 from njohnston/split_multiple_segments_fix
Fix drawing splits for tracks with multiple segments
This commit is contained in:
commit
2dad676e84
1 changed files with 15 additions and 15 deletions
|
@ -278,8 +278,7 @@ public class GPXLayer extends OsmandMapLayer implements ContextMenuLayer.IContex
|
||||||
// request to load
|
// request to load
|
||||||
for (SelectedGpxFile g : selectedGPXFiles) {
|
for (SelectedGpxFile g : selectedGPXFiles) {
|
||||||
List<GpxDisplayGroup> groups = g.getDisplayGroups();
|
List<GpxDisplayGroup> groups = g.getDisplayGroups();
|
||||||
if (groups != null) {
|
if (groups != null && !groups.isEmpty()) {
|
||||||
for (GpxDisplayGroup group : groups) {
|
|
||||||
GpxDataItem gpxDataItem = view.getApplication().getGpxDatabase().getItem(new File(g.getGpxFile().path));
|
GpxDataItem gpxDataItem = view.getApplication().getGpxDatabase().getItem(new File(g.getGpxFile().path));
|
||||||
int color = gpxDataItem.getColor();
|
int color = gpxDataItem.getColor();
|
||||||
if (color == 0) {
|
if (color == 0) {
|
||||||
|
@ -291,13 +290,14 @@ public class GPXLayer extends OsmandMapLayer implements ContextMenuLayer.IContex
|
||||||
|
|
||||||
paintInnerRect.setColor(color);
|
paintInnerRect.setColor(color);
|
||||||
paintInnerRect.setAlpha(179);
|
paintInnerRect.setAlpha(179);
|
||||||
List<GpxDisplayItem> items = group.getModifiableList();
|
|
||||||
|
List<GpxDisplayItem> items = groups.get(0).getModifiableList();
|
||||||
|
|
||||||
drawSplitItems(canvas, tileBox, items, settings);
|
drawSplitItems(canvas, tileBox, items, settings);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
|
||||||
|
|
||||||
private void drawSplitItems(Canvas canvas, RotatedTileBox tileBox, List<GpxDisplayItem> items, DrawSettings settings) {
|
private void drawSplitItems(Canvas canvas, RotatedTileBox tileBox, List<GpxDisplayItem> items, DrawSettings settings) {
|
||||||
final QuadRect latLonBounds = tileBox.getLatLonBounds();
|
final QuadRect latLonBounds = tileBox.getLatLonBounds();
|
||||||
|
|
Loading…
Reference in a new issue