Skip to content

Commit

Permalink
Merge pull request rkalla#112 from poxu/rotate_with_quadrantrotate
Browse files Browse the repository at this point in the history
Use quadrantRotate for rotations
  • Loading branch information
rkalla authored Sep 1, 2016
2 parents e1e1da7 + 4e3a8c7 commit c99e097
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions src/main/java/org/imgscalr/Scalr.java
Original file line number Diff line number Diff line change
Expand Up @@ -1857,7 +1857,7 @@ public static BufferedImage rotate(BufferedImage src, Rotation rotation,

// Reminder: newWidth == result.getHeight() at this point
tx.translate(newWidth, 0);
tx.rotate(Math.toRadians(90));
tx.quadrantRotate(1);

break;

Expand All @@ -1871,12 +1871,12 @@ public static BufferedImage rotate(BufferedImage src, Rotation rotation,

// Reminder: newHeight == result.getWidth() at this point
tx.translate(0, newHeight);
tx.rotate(Math.toRadians(-90));
tx.quadrantRotate(3);
break;

case CW_180:
tx.translate(newWidth, newHeight);
tx.rotate(Math.toRadians(180));
tx.quadrantRotate(2);
break;

case FLIP_HORZ:
Expand Down Expand Up @@ -2346,4 +2346,4 @@ protected static BufferedImage scaleImageIncrementally(BufferedImage src,
*/
return src;
}
}
}

0 comments on commit c99e097

Please sign in to comment.