Loading src/com/android/gallery3d/filtershow/FilterShowActivity.java +1 −0 Original line number Original line Diff line number Diff line Loading @@ -189,6 +189,7 @@ public class FilterShowActivity extends Activity implements OnItemClickListener, mImageRotate = (ImageRotate) findViewById(R.id.imageRotate); mImageRotate = (ImageRotate) findViewById(R.id.imageRotate); mImageFlip = (ImageFlip) findViewById(R.id.imageFlip); mImageFlip = (ImageFlip) findViewById(R.id.imageFlip); ImageCrop.setTouchTolerance((int) getPixelsFromDip(25)); mImageViews.add(mImageShow); mImageViews.add(mImageShow); mImageViews.add(mImageCurves); mImageViews.add(mImageCurves); mImageViews.add(mImageBorders); mImageViews.add(mImageBorders); Loading src/com/android/gallery3d/filtershow/imageshow/ImageCrop.java +9 −5 Original line number Original line Diff line number Diff line Loading @@ -45,7 +45,7 @@ public class ImageCrop extends ImageGeometry { private static final int BOTTOM_LEFT = MOVE_BOTTOM | MOVE_LEFT; private static final int BOTTOM_LEFT = MOVE_BOTTOM | MOVE_LEFT; private static final float MIN_CROP_WIDTH_HEIGHT = 0.1f; 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 boolean mFirstDraw = true; private float mAspectWidth = 1; private float mAspectWidth = 1; Loading Loading @@ -97,6 +97,10 @@ public class ImageCrop extends ImageGeometry { mAspectHeight = temp; mAspectHeight = temp; } } public static void setTouchTolerance(int tolerance){ mTouchTolerance = tolerance; } private boolean switchCropBounds(int moving_corner, RectF dst) { private boolean switchCropBounds(int moving_corner, RectF dst) { RectF crop = getCropBoundsDisplayed(); RectF crop = getCropBoundsDisplayed(); float dx1 = 0; float dx1 = 0; Loading Loading @@ -357,20 +361,20 @@ public class ImageCrop extends ImageGeometry { // Check left or right. // Check left or right. float left = Math.abs(x - cropped.left); float left = Math.abs(x - cropped.left); float right = Math.abs(x - cropped.right); float right = Math.abs(x - cropped.right); if ((left <= TOUCH_TOLERANCE) && (left < right)) { if ((left <= mTouchTolerance) && (left < right)) { movingEdges |= MOVE_LEFT; movingEdges |= MOVE_LEFT; } } else if (right <= TOUCH_TOLERANCE) { else if (right <= mTouchTolerance) { movingEdges |= MOVE_RIGHT; movingEdges |= MOVE_RIGHT; } } // Check top or bottom. // Check top or bottom. float top = Math.abs(y - cropped.top); float top = Math.abs(y - cropped.top); float bottom = Math.abs(y - cropped.bottom); float bottom = Math.abs(y - cropped.bottom); if ((top <= TOUCH_TOLERANCE) & (top < bottom)) { if ((top <= mTouchTolerance) & (top < bottom)) { movingEdges |= MOVE_TOP; movingEdges |= MOVE_TOP; } } else if (bottom <= TOUCH_TOLERANCE) { else if (bottom <= mTouchTolerance) { movingEdges |= MOVE_BOTTOM; movingEdges |= MOVE_BOTTOM; } } // Check inside block. // Check inside block. Loading Loading
src/com/android/gallery3d/filtershow/FilterShowActivity.java +1 −0 Original line number Original line Diff line number Diff line Loading @@ -189,6 +189,7 @@ public class FilterShowActivity extends Activity implements OnItemClickListener, mImageRotate = (ImageRotate) findViewById(R.id.imageRotate); mImageRotate = (ImageRotate) findViewById(R.id.imageRotate); mImageFlip = (ImageFlip) findViewById(R.id.imageFlip); mImageFlip = (ImageFlip) findViewById(R.id.imageFlip); ImageCrop.setTouchTolerance((int) getPixelsFromDip(25)); mImageViews.add(mImageShow); mImageViews.add(mImageShow); mImageViews.add(mImageCurves); mImageViews.add(mImageCurves); mImageViews.add(mImageBorders); mImageViews.add(mImageBorders); Loading
src/com/android/gallery3d/filtershow/imageshow/ImageCrop.java +9 −5 Original line number Original line Diff line number Diff line Loading @@ -45,7 +45,7 @@ public class ImageCrop extends ImageGeometry { private static final int BOTTOM_LEFT = MOVE_BOTTOM | MOVE_LEFT; private static final int BOTTOM_LEFT = MOVE_BOTTOM | MOVE_LEFT; private static final float MIN_CROP_WIDTH_HEIGHT = 0.1f; 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 boolean mFirstDraw = true; private float mAspectWidth = 1; private float mAspectWidth = 1; Loading Loading @@ -97,6 +97,10 @@ public class ImageCrop extends ImageGeometry { mAspectHeight = temp; mAspectHeight = temp; } } public static void setTouchTolerance(int tolerance){ mTouchTolerance = tolerance; } private boolean switchCropBounds(int moving_corner, RectF dst) { private boolean switchCropBounds(int moving_corner, RectF dst) { RectF crop = getCropBoundsDisplayed(); RectF crop = getCropBoundsDisplayed(); float dx1 = 0; float dx1 = 0; Loading Loading @@ -357,20 +361,20 @@ public class ImageCrop extends ImageGeometry { // Check left or right. // Check left or right. float left = Math.abs(x - cropped.left); float left = Math.abs(x - cropped.left); float right = Math.abs(x - cropped.right); float right = Math.abs(x - cropped.right); if ((left <= TOUCH_TOLERANCE) && (left < right)) { if ((left <= mTouchTolerance) && (left < right)) { movingEdges |= MOVE_LEFT; movingEdges |= MOVE_LEFT; } } else if (right <= TOUCH_TOLERANCE) { else if (right <= mTouchTolerance) { movingEdges |= MOVE_RIGHT; movingEdges |= MOVE_RIGHT; } } // Check top or bottom. // Check top or bottom. float top = Math.abs(y - cropped.top); float top = Math.abs(y - cropped.top); float bottom = Math.abs(y - cropped.bottom); float bottom = Math.abs(y - cropped.bottom); if ((top <= TOUCH_TOLERANCE) & (top < bottom)) { if ((top <= mTouchTolerance) & (top < bottom)) { movingEdges |= MOVE_TOP; movingEdges |= MOVE_TOP; } } else if (bottom <= TOUCH_TOLERANCE) { else if (bottom <= mTouchTolerance) { movingEdges |= MOVE_BOTTOM; movingEdges |= MOVE_BOTTOM; } } // Check inside block. // Check inside block. Loading