This commit is contained in:
Hannes Janetzek 2013-04-08 03:07:57 +02:00
parent 7145b067a0
commit 0043e8be78

View File

@ -119,10 +119,7 @@ public class PathOverlay extends Overlay {
int x, y, px = 0, py = 0; int x, y, px = 0, py = 0;
int i = 0; int i = 0;
//int mx = (int) mMapPosition.x; int z = curPos.zoomLevel;
//int my = (int) mMapPosition.y;
//int z = curPos.zoomLevel;
int z = FastMath.log2((int) curPos.scale);
int diff = MAX_ZOOM - z; int diff = MAX_ZOOM - z;
int mx = (int) (curPos.x * (Tile.SIZE << z)); int mx = (int) (curPos.x * (Tile.SIZE << z));
int my = (int) (curPos.y * (Tile.SIZE << z)); int my = (int) (curPos.y * (Tile.SIZE << z));
@ -132,9 +129,6 @@ public class PathOverlay extends Overlay {
x = (mPreprojected[j + 0] >> diff) - mx; x = (mPreprojected[j + 0] >> diff) - mx;
y = (mPreprojected[j + 1] >> diff) - my; y = (mPreprojected[j + 1] >> diff) - my;
//x = (mPreprojected[j + 0]) - mx;
//y = (mPreprojected[j + 1]) - my;
// TODO use line clipping, this doesnt work with 'GreatCircle' // TODO use line clipping, this doesnt work with 'GreatCircle'
// TODO clip to view bounding box // TODO clip to view bounding box
if (x > max || x < -max || y > max || y < -max) { if (x > max || x < -max || y > max || y < -max) {
@ -166,9 +160,7 @@ public class PathOverlay extends Overlay {
mMapPosition.scale = 1 << z; mMapPosition.scale = 1 << z;
newData = true; newData = true;
} }
} }
public PathOverlay(MapView mapView, final int color) { public PathOverlay(MapView mapView, final int color) {