Permalink
Browse files

set correct imageMode when drawing map

  • Loading branch information...
camillol committed Oct 20, 2011
1 parent 36ae625 commit 06fb407caa59ae10fbb85ce7b41591ef0281b2e4
Showing with 8 additions and 2 deletions.
  1. +2 −2 Makefile
  2. BIN modestmaps/library/modestmaps.jar
  3. +6 −0 src/com/modestmaps/InteractiveMap.java
View
@@ -3,9 +3,9 @@ PROCESSING_PATH = "/Applications/Processing.app/Contents/Resources/Java/core.jar
LIBRARY_PATH = "/Users/$(USER)/Documents/Processing/libraries/"
modestmaps/library/modestmaps.jar:
+ mkdir -p classes
javac -sourcepath src/ -cp $(PROCESSING_PATH) -d classes src/com/modestmaps/*.java src/com/modestmaps/core/*.java src/com/modestmaps/providers/*.java src/com/modestmaps/geo/*.java
- mkdir modestmaps
- mkdir modestmaps/library
+ mkdir -p modestmaps/library
jar cvf modestmaps/library/modestmaps.jar -C classes .
install: modestmaps/library/modestmaps.jar
Binary file not shown.
@@ -80,11 +80,15 @@ public void draw() {
// remember smooth setting so it can be reset
boolean smooth = p.g.smooth;
+ int imageMode = p.g.imageMode;
// !!! VERY IMPORTANT
// (all the renderers apart from OpenGL will choke if you ask for smooth scaling of image calls)
p.noSmooth();
+ // we need this, or our tiles will not be drawn in the right place
+ p.imageMode(p.CORNER);
+
// translate and scale, from the middle
p.pushMatrix();
p.translate(width/2, height/2);
@@ -243,6 +247,8 @@ public void draw() {
if (smooth) {
p.smooth();
}
+ // restore image mode
+ p.imageMode(imageMode);
}

0 comments on commit 06fb407

Please sign in to comment.