A viewport should also be considered changed if its dimensions have changed. This will cause the tile layer to be rendered correctly after an orientation change. #160

This commit is contained in:
Erik Duisters
2016-09-05 18:08:22 +02:00
committed by Emux
parent 9c1574eb41
commit ab98b676fc

View File

@@ -1,6 +1,7 @@
/*
* Copyright 2012 Hannes Janetzek
* Copyright 2016 devemux86
* Copyright 2016 Erik Duisters
*
* This file is part of the OpenScienceMap project (http://www.opensciencemap.org).
*
@@ -389,6 +390,8 @@ public class Viewport {
}
protected boolean copy(Viewport viewport) {
boolean sizeChanged = mHeight != viewport.mHeight || mWidth != viewport.mWidth;
mHeight = viewport.mHeight;
mWidth = viewport.mWidth;
mProjMatrix.copy(viewport.mProjMatrix);
@@ -399,7 +402,7 @@ public class Viewport {
mRotationMatrix.copy(viewport.mRotationMatrix);
mViewMatrix.copy(viewport.mViewMatrix);
mViewProjMatrix.copy(viewport.mViewProjMatrix);
return viewport.getMapPosition(mPos);
return viewport.getMapPosition(mPos) || sizeChanged;
}
public double getMaxScale() {