Skip to content

Commit ab98b67

Browse files
easduedevemux86
authored andcommitted
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. opensciencemap#160
1 parent 9c1574e commit ab98b67

File tree

1 file changed

+4
-1
lines changed

1 file changed

+4
-1
lines changed

vtm/src/org/oscim/map/Viewport.java

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
/*
22
* Copyright 2012 Hannes Janetzek
33
* Copyright 2016 devemux86
4+
* Copyright 2016 Erik Duisters
45
*
56
* This file is part of the OpenScienceMap project (http://www.opensciencemap.org).
67
*
@@ -389,6 +390,8 @@ public void toScreenPoint(double x, double y, boolean relativeToCenter, Point ou
389390
}
390391

391392
protected boolean copy(Viewport viewport) {
393+
boolean sizeChanged = mHeight != viewport.mHeight || mWidth != viewport.mWidth;
394+
392395
mHeight = viewport.mHeight;
393396
mWidth = viewport.mWidth;
394397
mProjMatrix.copy(viewport.mProjMatrix);
@@ -399,7 +402,7 @@ protected boolean copy(Viewport viewport) {
399402
mRotationMatrix.copy(viewport.mRotationMatrix);
400403
mViewMatrix.copy(viewport.mViewMatrix);
401404
mViewProjMatrix.copy(viewport.mViewProjMatrix);
402-
return viewport.getMapPosition(mPos);
405+
return viewport.getMapPosition(mPos) || sizeChanged;
403406
}
404407

405408
public double getMaxScale() {

0 commit comments

Comments
 (0)