summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorRuben Brunk <rubenbrunk@google.com>2012-10-23 14:48:58 -0700
committerRuben Brunk <rubenbrunk@google.com>2012-10-23 17:38:35 -0700
commitba18d1eceecddfe16e938c77878a56cf0dbadced (patch)
treef1c08ad78115edaf0371e920b0ba05df2f3df6ad
parent95a94afb783be6f01dac6c6c99ab3716cc456ca7 (diff)
downloadandroid_packages_apps_Snap-ba18d1eceecddfe16e938c77878a56cf0dbadced.tar.gz
android_packages_apps_Snap-ba18d1eceecddfe16e938c77878a56cf0dbadced.tar.bz2
android_packages_apps_Snap-ba18d1eceecddfe16e938c77878a56cf0dbadced.zip
Increased touch tolerance in cropping.
Bug: 7342281 Change-Id: Ice2ba5f07074b1518e4064bbda489aae7ba17b22
-rw-r--r--src/com/android/gallery3d/filtershow/FilterShowActivity.java1
-rw-r--r--src/com/android/gallery3d/filtershow/imageshow/ImageCrop.java14
2 files changed, 10 insertions, 5 deletions
diff --git a/src/com/android/gallery3d/filtershow/FilterShowActivity.java b/src/com/android/gallery3d/filtershow/FilterShowActivity.java
index 9db4d733b..1d8502f0b 100644
--- a/src/com/android/gallery3d/filtershow/FilterShowActivity.java
+++ b/src/com/android/gallery3d/filtershow/FilterShowActivity.java
@@ -189,6 +189,7 @@ public class FilterShowActivity extends Activity implements OnItemClickListener,
mImageRotate = (ImageRotate) findViewById(R.id.imageRotate);
mImageFlip = (ImageFlip) findViewById(R.id.imageFlip);
+ ImageCrop.setTouchTolerance((int) getPixelsFromDip(25));
mImageViews.add(mImageShow);
mImageViews.add(mImageCurves);
mImageViews.add(mImageBorders);
diff --git a/src/com/android/gallery3d/filtershow/imageshow/ImageCrop.java b/src/com/android/gallery3d/filtershow/imageshow/ImageCrop.java
index f0c520ae6..cfeceb059 100644
--- a/src/com/android/gallery3d/filtershow/imageshow/ImageCrop.java
+++ b/src/com/android/gallery3d/filtershow/imageshow/ImageCrop.java
@@ -45,7 +45,7 @@ public class ImageCrop extends ImageGeometry {
private static final int BOTTOM_LEFT = MOVE_BOTTOM | MOVE_LEFT;
private static final float MIN_CROP_WIDTH_HEIGHT = 0.1f;
- private static final int TOUCH_TOLERANCE = 30;
+ private static int mTouchTolerance = 45;
private boolean mFirstDraw = true;
private float mAspectWidth = 1;
@@ -97,6 +97,10 @@ public class ImageCrop extends ImageGeometry {
mAspectHeight = temp;
}
+ public static void setTouchTolerance(int tolerance){
+ mTouchTolerance = tolerance;
+ }
+
private boolean switchCropBounds(int moving_corner, RectF dst) {
RectF crop = getCropBoundsDisplayed();
float dx1 = 0;
@@ -357,20 +361,20 @@ public class ImageCrop extends ImageGeometry {
// Check left or right.
float left = Math.abs(x - cropped.left);
float right = Math.abs(x - cropped.right);
- if ((left <= TOUCH_TOLERANCE) && (left < right)) {
+ if ((left <= mTouchTolerance) && (left < right)) {
movingEdges |= MOVE_LEFT;
}
- else if (right <= TOUCH_TOLERANCE) {
+ else if (right <= mTouchTolerance) {
movingEdges |= MOVE_RIGHT;
}
// Check top or bottom.
float top = Math.abs(y - cropped.top);
float bottom = Math.abs(y - cropped.bottom);
- if ((top <= TOUCH_TOLERANCE) & (top < bottom)) {
+ if ((top <= mTouchTolerance) & (top < bottom)) {
movingEdges |= MOVE_TOP;
}
- else if (bottom <= TOUCH_TOLERANCE) {
+ else if (bottom <= mTouchTolerance) {
movingEdges |= MOVE_BOTTOM;
}
// Check inside block.