Minor updates.

This commit is contained in:
Bartlomiej Niechwiej
2010-10-22 10:00:15 -07:00
parent b70e001206
commit a3793aa92b
2 changed files with 4 additions and 1 deletions
@@ -295,11 +295,14 @@ public class MyTracksOverlay extends Overlay {
} else { } else {
int numPoints = points.size(); int numPoints = points.size();
if (numPoints < 2) { if (numPoints < 2) {
// Not enough points to draw a path.
path = null; path = null;
} else if (lastPath != null && !newProjection) { } else if (lastPath != null && !newProjection) {
// Incremental update of the path, without repositioning the view.
path = lastPath; path = lastPath;
updatePath(projection, viewRect, path, numPoints - newPoints); updatePath(projection, viewRect, path, numPoints - newPoints);
} else { } else {
// The view has changed so we have to start from scratch.
path = newPath(); path = newPath();
path.incReserve(numPoints); path.incReserve(numPoints);
updatePath(projection, viewRect, path, 0); updatePath(projection, viewRect, path, 0);
@@ -98,7 +98,7 @@ public class MyTracksOverlayTest extends AndroidTestCase {
/** /**
* A mock {@code Projection} that acts as the identity matrix. * A mock {@code Projection} that acts as the identity matrix.
*/ */
private static class MockProjection implements Projection { private static class MockProjection implements Projection {
@Override @Override
public Point toPixels(GeoPoint in, Point out) { public Point toPixels(GeoPoint in, Point out) {
return out; return out;