Scale factor for short vertices calculation, fix #537
This commit is contained in:
@@ -1,6 +1,7 @@
|
||||
/*
|
||||
* Copyright 2012, 2013 Hannes Janetzek
|
||||
* Copyright 2016 Longri
|
||||
* Copyright 2018 devemux86
|
||||
*
|
||||
* This file is part of the OpenScienceMap project (http://www.opensciencemap.org).
|
||||
*
|
||||
@@ -17,6 +18,7 @@
|
||||
*/
|
||||
package org.oscim.renderer;
|
||||
|
||||
import org.oscim.backend.CanvasAdapter;
|
||||
import org.oscim.backend.GL;
|
||||
import org.oscim.backend.GLAdapter;
|
||||
import org.oscim.backend.canvas.Color;
|
||||
@@ -75,6 +77,17 @@ public class MapRenderer {
|
||||
setBackgroundColor(Color.DKGRAY);
|
||||
}
|
||||
|
||||
/**
|
||||
* Calculate scale factor for short vertices.
|
||||
* <p>
|
||||
* CanvasAdapter.dpi must be set before!
|
||||
*/
|
||||
public static float calculateCoordScale() {
|
||||
if (CanvasAdapter.dpi > 420)
|
||||
return 4.0f;
|
||||
return 8.0f;
|
||||
}
|
||||
|
||||
public static void setBackgroundColor(int color) {
|
||||
mClearColor = GLUtils.colorToFloat(color);
|
||||
}
|
||||
|
||||
@@ -21,6 +21,11 @@ public final class Parameters {
|
||||
*/
|
||||
public static boolean ANIMATOR2 = false;
|
||||
|
||||
/**
|
||||
* Allow custom scale factor for short vertices instead of the calculated one.
|
||||
*/
|
||||
public static boolean CUSTOM_COORD_SCALE = false;
|
||||
|
||||
/**
|
||||
* Allow custom tile size instead of the calculated one.
|
||||
*/
|
||||
|
||||
Reference in New Issue
Block a user