Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Browse files

set correct imageMode when drawing map

  • Loading branch information...
commit 06fb407caa59ae10fbb85ce7b41591ef0281b2e4 1 parent 36ae625
@camillol camillol authored
View
4 Makefile
@@ -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
View
BIN  modestmaps/library/modestmaps.jar
Binary file not shown
View
6 src/com/modestmaps/InteractiveMap.java
@@ -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);
}
Please sign in to comment.
Something went wrong with that request. Please try again.