ViewController: refactor 'setScreenSize' to 'setViewSize', 'setMapScreenCenter' to 'setMapViewCenter' (#523)

This commit is contained in:
Gustl22
2018-04-12 11:19:21 +02:00
committed by Emux
parent d036bb0bac
commit d7aad27ed8
5 changed files with 13 additions and 13 deletions

View File

@@ -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();