Skip to content

Commit

Permalink
Use getRequiredRotation() for non-tiled images
Browse files Browse the repository at this point in the history
The current version uses `getOrientation()` which is -1 if
ORIENTATION_USE_EXIF is set. Rotating the image by -1 is bad.
  • Loading branch information
ulyssesdotcodes committed Oct 12, 2015
1 parent 7f1a51c commit c159beb
Showing 1 changed file with 4 additions and 4 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -975,14 +975,14 @@ protected void onDraw(Canvas canvas) {
if (matrix == null) { matrix = new Matrix(); }
matrix.reset();
matrix.postScale(xScale, yScale);
matrix.postRotate(getOrientation());
matrix.postRotate(getRequiredRotation());
matrix.postTranslate(vTranslate.x, vTranslate.y);

if (getOrientation() == ORIENTATION_180) {
if (getRequiredRotation() == ORIENTATION_180) {
matrix.postTranslate(scale * sWidth, scale * sHeight);
} else if (getOrientation() == ORIENTATION_90) {
} else if (getRequiredRotation() == ORIENTATION_90) {
matrix.postTranslate(scale * sHeight, 0);
} else if (getOrientation() == ORIENTATION_270) {
} else if (getRequiredRotation() == ORIENTATION_270) {
matrix.postTranslate(0, scale * sWidth);
}

Expand Down

0 comments on commit c159beb

Please sign in to comment.