summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorRuben Brunk <rubenbrunk@google.com>2012-10-23 18:08:12 -0700
committerAndroid Git Automerger <android-git-automerger@android.com>2012-10-23 18:08:12 -0700
commit0763e4e0cc7d5495b703e813f21c7e6982a9ed9e (patch)
treec04ea93f9e63e1f7aa7cfbe93bca732222da8db5
parent2f6d6bd2e608bda63879cbeff376ebeb862d99bb (diff)
parentba18d1eceecddfe16e938c77878a56cf0dbadced (diff)
downloadandroid_packages_apps_Snap-0763e4e0cc7d5495b703e813f21c7e6982a9ed9e.tar.gz
android_packages_apps_Snap-0763e4e0cc7d5495b703e813f21c7e6982a9ed9e.tar.bz2
android_packages_apps_Snap-0763e4e0cc7d5495b703e813f21c7e6982a9ed9e.zip
am f46da69a: Increased touch tolerance in cropping.
* commit 'f46da69aefd9afe0b4326a2fcea8e33c294136bb': Increased touch tolerance in cropping.
-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.