fix small bugs

git-svn-id: https://osmand.googlecode.com/svn/trunk@316 e29c36b1-1cfa-d876-8d93-3434fc2bb7b8
This commit is contained in:
Victor Shcherb 2010-07-10 22:46:17 +00:00
parent 97b00ef47e
commit feaf5f9d17
2 changed files with 11 additions and 3 deletions

View file

@ -59,7 +59,9 @@ public class AnimateDraggingMapThread implements Runnable {
} }
} }
if (!stopped && callback != null) { if (!stopped && callback != null) {
if (vx > 0 || vy > 0) {
callback.dragTo(curX, curY, newX, newY); callback.dragTo(curX, curY, newX, newY);
}
if(newZ > 0){ if(newZ > 0){
callback.zoomTo(newZ); callback.zoomTo(newZ);
} }
@ -108,6 +110,7 @@ public class AnimateDraggingMapThread implements Runnable {
} else { } else {
dirZ = -1; dirZ = -1;
} }
vx = 0;
curZ = zoomStart; curZ = zoomStart;
endZ = zoomEnd; endZ = zoomEnd;
timeZ = 600; timeZ = 600;
@ -129,6 +132,9 @@ public class AnimateDraggingMapThread implements Runnable {
vy = velocityY; vy = velocityY;
dirX = (byte) (endX > startX ? 1 : -1); dirX = (byte) (endX > startX ? 1 : -1);
dirY = (byte) (endY > startY ? 1 : -1); dirY = (byte) (endY > startY ? 1 : -1);
curZ = 0;
endZ = 0;
timeZ = 0;
ax = vx * a; ax = vx * a;
ay = vy * a; ay = vy * a;
time = System.currentTimeMillis(); time = System.currentTimeMillis();

View file

@ -227,9 +227,11 @@ public class OsmandMapTileView extends SurfaceView implements IMapDownloaderCall
// for internal usage // for internal usage
@Override @Override
public void zoomTo(float zoom) { public void zoomTo(float zoom) {
if (map == null || (map.getMaximumZoomSupported() >= zoom && map.getMinimumZoomSupported() <= zoom)) {
this.zoom = zoom; this.zoom = zoom;
refreshMap(); refreshMap();
} }
}
public void setRotate(float rotate) { public void setRotate(float rotate) {
float dif = this.rotate - rotate; float dif = this.rotate - rotate;