Skip to content

Commit

Permalink
A viewport should also be considered changed if its dimensions have c…
Browse files Browse the repository at this point in the history
…hanged. This will cause the tile layer to be rendered correctly after an orientation change. opensciencemap#160
  • Loading branch information
easdue authored and devemux86 committed Sep 6, 2016
1 parent 9c1574e commit ab98b67
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion vtm/src/org/oscim/map/Viewport.java
Original file line number Diff line number Diff line change
@@ -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).
*
Expand Down Expand Up @@ -389,6 +390,8 @@ public void toScreenPoint(double x, double y, boolean relativeToCenter, Point ou
}

protected boolean copy(Viewport viewport) {
boolean sizeChanged = mHeight != viewport.mHeight || mWidth != viewport.mWidth;

mHeight = viewport.mHeight;
mWidth = viewport.mWidth;
mProjMatrix.copy(viewport.mProjMatrix);
Expand All @@ -399,7 +402,7 @@ protected boolean copy(Viewport 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() {
Expand Down

0 comments on commit ab98b67

Please sign in to comment.