Skip to content

Commit 9aa1661

Browse files
committed
hot-fix (crop rectangle state restore broken in 2.4.1)
1 parent eef913e commit 9aa1661

3 files changed

Lines changed: 4 additions & 4 deletions

File tree

README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -120,7 +120,7 @@ For more information, see the [GitHub Wiki](https://github.com/ArthurHub/Android
120120
- [Adding auto-zoom feature to Android-Image-Cropper](https://theartofdev.com/2016/04/25/adding-auto-zoom-feature-to-android-image-cropper/)
121121

122122
## Change log
123-
*2.4.1*
123+
*2.4.2*
124124

125125
- Fix instance state saved before any image loaded resulted in corrupted initial crop rectangle.
126126
- Fix corners of crop overlay offset for oval shape resulting in confusing UI (#256).

cropper/build.gradle

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ apply plugin: 'maven-publish'
66
ext {
77
PUBLISH_GROUP_ID = 'com.theartofdev.edmodo'
88
PUBLISH_ARTIFACT_ID = 'android-image-cropper'
9-
PUBLISH_VERSION = '2.4.1'
9+
PUBLISH_VERSION = '2.4.2'
1010
// gradlew clean build generateRelease
1111
}
1212

cropper/src/main/java/com/theartofdev/edmodo/cropper/CropImageView.java

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1235,12 +1235,12 @@ public void onRestoreInstanceState(Parcelable state) {
12351235
mDegreesRotated = bundle.getInt("DEGREES_ROTATED");
12361236

12371237
Rect initialCropRect = bundle.getParcelable("INITIAL_CROP_RECT");
1238-
if (initialCropRect != null && (initialCropRect.width() < 1 || initialCropRect.height() < 1)) {
1238+
if (initialCropRect != null && (initialCropRect.width() > 0 || initialCropRect.height() > 0)) {
12391239
mCropOverlayView.setInitialCropWindowRect(initialCropRect);
12401240
}
12411241

12421242
RectF cropWindowRect = bundle.getParcelable("CROP_WINDOW_RECT");
1243-
if (cropWindowRect != null && (cropWindowRect.width() < 1 || cropWindowRect.height() < 1)) {
1243+
if (cropWindowRect != null && (cropWindowRect.width() > 0 || cropWindowRect.height() > 0)) {
12441244
mRestoreCropWindowRect = cropWindowRect;
12451245
}
12461246

0 commit comments

Comments
 (0)