fix: GLViewport.useScreenCoordinates
- fixes: MapScaleBar not being visible
This commit is contained in:
parent
711ca7f6d9
commit
d32b13fed4
@ -24,14 +24,12 @@ public class GLViewport extends Viewport {
|
|||||||
* being center
|
* being center
|
||||||
*/
|
*/
|
||||||
public void useScreenCoordinates(boolean center, float scale) {
|
public void useScreenCoordinates(boolean center, float scale) {
|
||||||
float ratio = (1f / (scale * mWidth));
|
float invScale = 1f / scale;
|
||||||
|
|
||||||
if (center)
|
if (center)
|
||||||
mvp.setScale(ratio, ratio, ratio);
|
mvp.setScale(invScale, invScale, invScale);
|
||||||
else
|
else
|
||||||
mvp.setTransScale((-mWidth / 2) * ratio * scale,
|
mvp.setTransScale(-mWidth / 2, -mHeight / 2, invScale);
|
||||||
(-mHeight / 2) * ratio * scale,
|
|
||||||
ratio);
|
|
||||||
|
|
||||||
mvp.multiplyLhs(proj);
|
mvp.multiplyLhs(proj);
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user