Skip to content

Commit

Permalink
Fix rotation zooms and changes aspect ratio when fixed aspect ratio i…
Browse files Browse the repository at this point in the history
…s used.
  • Loading branch information
Arthur committed Jun 6, 2016
1 parent 679fabf commit d5f8254
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 2 deletions.
4 changes: 4 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -103,6 +103,10 @@ For more information, see the [GitHub Wiki](https://github.com/ArthurHub/Android
- [Adding auto-zoom feature to Android-Image-Cropper](https://theartofdev.com/2016/04/25/adding-auto-zoom-feature-to-android-image-cropper/)

## Change log
*2.2.2*

- Fix rotation zooms and changes aspect ratio when fixed aspect ratio is used.

*2.2.1*

- Fix listeners getting garbage collected bug (thx @TheFinestArtist)
Expand Down
2 changes: 1 addition & 1 deletion cropper/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ apply plugin: 'maven-publish'
ext {
PUBLISH_GROUP_ID = 'com.theartofdev.edmodo'
PUBLISH_ARTIFACT_ID = 'android-image-cropper'
PUBLISH_VERSION = '2.2.1'
PUBLISH_VERSION = '2.2.2'
// gradlew clean build generateRelease
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -759,7 +759,7 @@ public void clearImage() {
public void rotateImage(int degrees) {
if (mBitmap != null) {

boolean flipAxes = (degrees > 45 && degrees < 135) || (degrees > 215 && degrees < 305);
boolean flipAxes = !mCropOverlayView.isFixAspectRatio() && (degrees > 45 && degrees < 135) || (degrees > 215 && degrees < 305);
BitmapUtils.RECT.set(mCropOverlayView.getCropWindowRect());
float halfWidth = (flipAxes ? BitmapUtils.RECT.height() : BitmapUtils.RECT.width()) / 2f;
float halfHeight = (flipAxes ? BitmapUtils.RECT.width() : BitmapUtils.RECT.height()) / 2f;
Expand Down

0 comments on commit d5f8254

Please sign in to comment.