Skip to content

Commit

Permalink
Minor fix related to PhilJay#1565
Browse files Browse the repository at this point in the history
  • Loading branch information
PhilJay committed Mar 10, 2016
1 parent 0214e19 commit 7667501
Showing 1 changed file with 7 additions and 4 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -304,9 +304,12 @@ protected void onSizeChanged(int w, int h, int oldw, int oldh) {
//Superclass transforms chart.
super.onSizeChanged(w, h, oldw, oldh);

//Restoring old position of chart.
getTransformer(AxisDependency.LEFT).pointValuesToPixel(pts);
mViewPortHandler.centerViewPort(pts, this);
if(mKeepPositionOnRotation) {

//Restoring old position of chart.
getTransformer(AxisDependency.LEFT).pointValuesToPixel(pts);
mViewPortHandler.centerViewPort(pts, this);
}
}

/**
Expand Down Expand Up @@ -1238,7 +1241,7 @@ public boolean isKeepPositionOnRotation() {
}

/**
* Sets the whether the chart should keep its position after a rotation.
* Sets whether the chart should keep its position (zoom / scroll) after a rotation (orientation change)
*/
public void setKeepPositionOnRotation(boolean keepPositionOnRotation) {
mKeepPositionOnRotation = keepPositionOnRotation;
Expand Down

0 comments on commit 7667501

Please sign in to comment.