diff --git a/OsmAnd-java/src/net/osmand/RenderingContext.java b/OsmAnd-java/src/net/osmand/RenderingContext.java index 4297912146..d6536b3a90 100644 --- a/OsmAnd-java/src/net/osmand/RenderingContext.java +++ b/OsmAnd-java/src/net/osmand/RenderingContext.java @@ -28,13 +28,13 @@ public class RenderingContext { } - public float leftX; - public float topY; + public double leftX; + public double topY; public int width; public int height; public int zoom; - public float tileDivisor; + public double tileDivisor; public float rotate; // debug purpose diff --git a/OsmAnd/src/net/osmand/plus/render/MapRenderRepositories.java b/OsmAnd/src/net/osmand/plus/render/MapRenderRepositories.java index 938a87d1be..7f3a049a82 100644 --- a/OsmAnd/src/net/osmand/plus/render/MapRenderRepositories.java +++ b/OsmAnd/src/net/osmand/plus/render/MapRenderRepositories.java @@ -586,11 +586,11 @@ public class MapRenderRepositories { final QuadPointDouble lt = requestedBox.getLeftTopTile(requestedBox.getZoom()); // LatLon ltn = requestedBox.getLeftTopLatLon(); final float mapDensity = (float) Math.pow(2, requestedBox.getZoomScale()); - final float tileDivisor = (float) MapUtils.getPowZoom(31 - requestedBox.getZoom() - + final double tileDivisor = MapUtils.getPowZoom(31 - requestedBox.getZoom() - requestedBox.getZoomScale()); - currentRenderingContext.leftX = (float) (lt.x * MapUtils.getPowZoom(requestedBox.getZoomScale())); + currentRenderingContext.leftX = lt.x * MapUtils.getPowZoom(requestedBox.getZoomScale()); // MapUtils.get31TileNumberX(ltn.getLongitude()) / tileDivisor; - currentRenderingContext.topY = (float) (lt.y * MapUtils.getPowZoom(requestedBox.getZoomScale())); + currentRenderingContext.topY = lt.y * MapUtils.getPowZoom(requestedBox.getZoomScale()); //MapUtils.get31TileNumberY(ltn.getLatitude()) / tileDivisor; currentRenderingContext.zoom = requestedBox.getZoom(); currentRenderingContext.rotate = requestedBox.getRotate(); diff --git a/OsmAnd/src/net/osmand/plus/render/OsmandRenderer.java b/OsmAnd/src/net/osmand/plus/render/OsmandRenderer.java index 2874069451..259fdc22be 100644 --- a/OsmAnd/src/net/osmand/plus/render/OsmandRenderer.java +++ b/OsmAnd/src/net/osmand/plus/render/OsmandRenderer.java @@ -415,10 +415,10 @@ public class OsmandRenderer { private PointF calcPoint(int xt, int yt, RenderingContext rc){ rc.pointCount ++; - float tx = xt / rc.tileDivisor; - float ty = yt / rc.tileDivisor; - float dTileX = tx - rc.leftX; - float dTileY = ty - rc.topY; + double tx = xt / rc.tileDivisor; + double ty = yt / rc.tileDivisor; + float dTileX = (float) (tx - rc.leftX); + float dTileY = (float) (ty - rc.topY); float x = rc.cosRotateTileSize * dTileX - rc.sinRotateTileSize * dTileY; float y = rc.sinRotateTileSize * dTileX + rc.cosRotateTileSize * dTileY; rc.tempPoint.set(x, y);