Skip to content

Commit

Permalink
Merge pull request #2 from camillol/master
Browse files Browse the repository at this point in the history
Do not draw offscreen tiles
  • Loading branch information
RandomEtc committed Nov 19, 2011
2 parents 89cd558 + 8b9b22d commit d9ba679
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 2 deletions.
Binary file modified modestmaps/library/modestmaps.jar
Binary file not shown.
4 changes: 2 additions & 2 deletions src/com/modestmaps/InteractiveMap.java
Original file line number Original file line Diff line number Diff line change
Expand Up @@ -120,9 +120,9 @@ public void draw() {


// find start and end columns // find start and end columns
int minCol = (int)p.floor(cols * (screenMinX-minX) / (maxX-minX)); 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 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) // pad a bit, for luck (well, because we might be zooming out between zoom levels)
minCol -= GRID_PADDING; minCol -= GRID_PADDING;
Expand Down

0 comments on commit d9ba679

Please sign in to comment.