diff --git a/vtm-android/src/org/oscim/android/MapView.java b/vtm-android/src/org/oscim/android/MapView.java index 15f9948d..4ced50a3 100644 --- a/vtm-android/src/org/oscim/android/MapView.java +++ b/vtm-android/src/org/oscim/android/MapView.java @@ -149,7 +149,7 @@ public class MapView extends GLSurfaceView { if (!isInEditMode()) { if (width > 0 && height > 0) - mMap.viewport().setScreenSize(width, height); + mMap.viewport().setViewSize(width, height); } } diff --git a/vtm-gdx/src/org/oscim/gdx/GdxMap.java b/vtm-gdx/src/org/oscim/gdx/GdxMap.java index 357e072b..4fd5dc4d 100644 --- a/vtm-gdx/src/org/oscim/gdx/GdxMap.java +++ b/vtm-gdx/src/org/oscim/gdx/GdxMap.java @@ -76,7 +76,7 @@ public abstract class GdxMap implements ApplicationListener { int w = Gdx.graphics.getWidth(); int h = Gdx.graphics.getHeight(); - mMap.viewport().setScreenSize(w, h); + mMap.viewport().setViewSize(w, h); mMapRenderer.onSurfaceCreated(); mMapRenderer.onSurfaceChanged(w, h); @@ -116,7 +116,7 @@ public abstract class GdxMap implements ApplicationListener { @Override public void resize(int w, int h) { - mMap.viewport().setScreenSize(w, h); + mMap.viewport().setViewSize(w, h); mMapRenderer.onSurfaceChanged(w, h); mMap.render(); } diff --git a/vtm-playground/src/org/oscim/test/GdxSpriteBatchTest.java b/vtm-playground/src/org/oscim/test/GdxSpriteBatchTest.java index 9336336f..42e20c3a 100644 --- a/vtm-playground/src/org/oscim/test/GdxSpriteBatchTest.java +++ b/vtm-playground/src/org/oscim/test/GdxSpriteBatchTest.java @@ -62,7 +62,7 @@ public class GdxSpriteBatchTest extends GdxMapApp { mMapRenderer = new MapRenderer(mMap); mMapRenderer.onSurfaceCreated(); mMapRenderer.onSurfaceChanged(Gdx.graphics.getWidth(), Gdx.graphics.getHeight()); - mMap.viewport().setScreenSize(Gdx.graphics.getWidth(), Gdx.graphics.getHeight()); + mMap.viewport().setViewSize(Gdx.graphics.getWidth(), Gdx.graphics.getHeight()); // Generate a simple texture for testing Pixmap pixmap = new Pixmap(64, 64, Pixmap.Format.RGB565); @@ -115,7 +115,7 @@ public class GdxSpriteBatchTest extends GdxMapApp { @Override public void resize(int w, int h) { mMapRenderer.onSurfaceChanged(w, h); - mMap.viewport().setScreenSize(w, h); + mMap.viewport().setViewSize(w, h); viewport.update(w, h); } diff --git a/vtm-theme-comparator/src/org/oscim/theme/comparator/vtm/MapApplicationAdapter.java b/vtm-theme-comparator/src/org/oscim/theme/comparator/vtm/MapApplicationAdapter.java index d2e1a96e..6815bf84 100644 --- a/vtm-theme-comparator/src/org/oscim/theme/comparator/vtm/MapApplicationAdapter.java +++ b/vtm-theme-comparator/src/org/oscim/theme/comparator/vtm/MapApplicationAdapter.java @@ -76,7 +76,7 @@ public class MapApplicationAdapter extends ApplicationAdapter { Gdx.app.postRunnable(new Runnable() { @Override public void run() { - map.viewport().setScreenSize(MapApplicationAdapter.this.width, MapApplicationAdapter.this.height); + map.viewport().setViewSize(MapApplicationAdapter.this.width, MapApplicationAdapter.this.height); mapRenderer.onSurfaceChanged(MapApplicationAdapter.this.width, MapApplicationAdapter.this.height); } }); @@ -129,7 +129,7 @@ public class MapApplicationAdapter extends ApplicationAdapter { int w = Gdx.graphics.getWidth(); int h = Gdx.graphics.getHeight(); - map.viewport().setScreenSize(w, h); + map.viewport().setViewSize(w, h); mapRenderer.onSurfaceCreated(); mapRenderer.onSurfaceChanged(w, h); diff --git a/vtm/src/org/oscim/map/ViewController.java b/vtm/src/org/oscim/map/ViewController.java index ead1ab35..d71622cd 100644 --- a/vtm/src/org/oscim/map/ViewController.java +++ b/vtm/src/org/oscim/map/ViewController.java @@ -33,7 +33,7 @@ public class ViewController extends Viewport { private final float[] mat = new float[16]; - public void setScreenSize(int width, int height) { + public void setViewSize(int width, int height) { ThreadUtils.assertMainThread(); mHeight = height; @@ -72,11 +72,11 @@ public class ViewController extends Viewport { } /** - * Set pivot height relative to screen center. E.g. 0.5 is usually preferred - * for navigation, moving the center to 25% of the screen height. + * Set pivot height relative to view center. E.g. 0.5 is usually preferred + * for navigation, moving the center to 25% of the view height. * Range is [-1, 1]. */ - public void setMapScreenCenter(float pivotY) { + public void setMapViewCenter(float pivotY) { mPivotY = FastMath.clamp(pivotY, -1, 1) * 0.5f; } @@ -144,7 +144,7 @@ public class ViewController extends Viewport { /** * Scale map by scale width center at pivot in pixel relative to - * screen center. Map scale is clamp to MIN_SCALE and MAX_SCALE. + * view center. Map scale is clamp to MIN_SCALE and MAX_SCALE. * * @return true if scale was changed */ @@ -178,7 +178,7 @@ public class ViewController extends Viewport { /** * Rotate map by radians around pivot. Pivot is in pixel relative - * to screen center. + * to view center. */ public void rotateMap(double radians, float pivotX, float pivotY) { ThreadUtils.assertMainThread();