Permalink
Browse files

Merge pull request #2 from camillol/master

Do not draw offscreen tiles
  • Loading branch information...
RandomEtc committed Nov 19, 2011
2 parents 89cd558 + 8b9b22d commit d9ba6790606c13b371f78cfe626f1ce2aae80b65
Showing with 2 additions and 2 deletions.
  1. BIN modestmaps/library/modestmaps.jar
  2. +2 −2 src/com/modestmaps/InteractiveMap.java
Binary file not shown.
@@ -120,9 +120,9 @@ public void draw() {
// find start and end columns
int minCol = (int)p.floor(cols * (screenMinX-minX) / (maxX-minX));
- int maxCol = (int)p.ceil(cols * (screenMaxX-minX) / (maxX-minX));
+ int maxCol = (int)p.ceil(cols * (screenMaxX-minX) / (maxX-minX)) - 1;
int minRow = (int)p.floor(rows * (screenMinY-minY) / (maxY-minY));
- int maxRow = (int)p.ceil(rows * (screenMaxY-minY) / (maxY-minY));
+ int maxRow = (int)p.ceil(rows * (screenMaxY-minY) / (maxY-minY)) - 1;
// pad a bit, for luck (well, because we might be zooming out between zoom levels)
minCol -= GRID_PADDING;

0 comments on commit d9ba679

Please sign in to comment.