Fix issue with path taking too long to be drawn due to useless syncrhonization.

This commit is contained in:
Holt59
2018-03-11 22:51:34 +01:00
parent 4af68f9f93
commit 8200497675
2 changed files with 9 additions and 4 deletions

View File

@@ -414,9 +414,11 @@ public class MapViewDrawing extends MapView implements Drawing {
@Override
public PathOverlay drawPath(Path path, Color color, boolean markers) {
PolylineAutoScaling line = new PolylineAutoScaling(1, DEFAULT_PATH_COLOR);
ArrayList<Point> points = new ArrayList<>(path.getArcs().size() * 4);
for (Arc arc: path.getArcs()) {
line.add(arc.getPoints());
points.addAll(arc.getPoints());
}
line.addAll(points);
PathOverlay overlay = null;
if (markers) {
MarkerAutoScaling origin = createMarker(path.getOrigin().getPoint(),