Skip to content

Commit

Permalink
#54 fix rotation to negative degrees
Browse files Browse the repository at this point in the history
  • Loading branch information
Arthur committed Apr 28, 2016
1 parent ada930c commit 1e7cc9d
Show file tree
Hide file tree
Showing 4 changed files with 8 additions and 4 deletions.
4 changes: 4 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -73,6 +73,10 @@ For more information, see the [linked Github Wiki page](https://github.com/Arthu
- [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.0.1* (Beta)

- Fix counter clockwise rotation resulting in negative degrees (#54).

*2.0.0* (Beta)

- **Auto-zoom**: zoom-in when crop window takes less than 50% of the image, zoom-out when more than 65%.
Expand Down
2 changes: 1 addition & 1 deletion build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ buildscript {
jcenter()
}
dependencies {
classpath 'com.android.tools.build:gradle:2.0.0'
classpath 'com.android.tools.build:gradle:2.1.0'
}
}

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.0.0'
PUBLISH_VERSION = '2.0.1'
// gradlew clean build generateRelease
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -744,7 +744,7 @@ public void rotateImage(int degrees) {
mZoomOffsetX = 0;
mZoomOffsetY = 0;
mDegreesRotated += degrees;
mDegreesRotated = mDegreesRotated % 360;
mDegreesRotated = mDegreesRotated >= 0 ? mDegreesRotated % 360 : mDegreesRotated % 360 + 360;

applyImageMatrix(getWidth(), getHeight(), true, false);

Expand All @@ -758,7 +758,7 @@ public void rotateImage(int degrees) {
} else {

mDegreesRotated += degrees;
mDegreesRotated = mDegreesRotated % 360;
mDegreesRotated = mDegreesRotated >= 0 ? mDegreesRotated % 360 : mDegreesRotated % 360 + 360;

mZoom = 1;
mZoomOffsetX = mZoomOffsetY = 0;
Expand Down

0 comments on commit 1e7cc9d

Please sign in to comment.