ArthurHub / ArthurHub/Android-Image-Cropper

setInitialCropWindowRectangle does not work for small rectangles

Open
#748 1 comment 0 reactions 0 assignees View on GitHub
Dominant language
Java
Stars
6.4k
Forks
1.4k
PR merge metrics
No merged PRs in 30d

Description

hi,
I use the CropImage Activity in my app.

I start the crop with the following configuration:
```
public void editRectangle(MeasurementsRectangle rect) {
nextRectKey = Utils.getKeysByValue(rects, rect);
CropImage.activity(monitorImageUri)
.setInitialCropWindowRectangle(rect.getRect())
.start(getContext(), this);
}
```

and except the result with :
```
public void onActivityResult(int requestCode, int resultCode, Intent data) {

// handle result of CropImageActivity
if (requestCode == CropImage.CROP_IMAGE_ACTIVITY_REQUEST_CODE) {
if (resultCode == RESULT_OK) {
CropImage.ActivityResult result = CropImage.getActivityResult(data);
Rect rect = result.getCropRect();
```

On small rectangles, even if the I dont touch the cropping windows, the result rectangle is different then InitialCropWindowRectangle rectangle.
For example:
start rectangle: Rect(0, 0, 102, 87)
result rectangle: Rect(0, 0, 135, 128)

But on big rectangles they are the same for example:
start rectangle: Rect(144, 108, 757, 510)
result rectangle: Rect(144,108, 757, 510)

thank you very much!!!

Contributor guide

No contributing guide indexed for this repository

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.