summaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorDanny Baumann <dannybaumann@web.de>2016-01-10 14:14:25 +0100
committerGerrit Code Review <gerrit@cyanogenmod.org>2016-01-11 10:43:58 -0800
commit8f10ee0855ba35a2e7dce8534edb81a420d14d5c (patch)
treefba7c92056449a376d93beee2fe05bf73ddf0660 /src
parent6f1634723975e0acc88f2940d0488b315e7dd127 (diff)
downloadandroid_packages_apps_Snap-8f10ee0855ba35a2e7dce8534edb81a420d14d5c.tar.gz
android_packages_apps_Snap-8f10ee0855ba35a2e7dce8534edb81a420d14d5c.tar.bz2
android_packages_apps_Snap-8f10ee0855ba35a2e7dce8534edb81a420d14d5c.zip
Don't do touch-to-focus for touches outside of the preview.
Issue was twofold: - Preview size was updated from the root view instead of the preview surface view. As the preview rect is already correctly updated from the surface view, remove the redundant size update code. - Touches outside of the preview rect weren't discarded properly. Change-Id: I1c9a4398aa51a828b5362fcd7bcd5a7a7e4691db
Diffstat (limited to 'src')
-rw-r--r--src/com/android/camera/FocusOverlayManager.java2
-rw-r--r--src/com/android/camera/PhotoModule.java6
2 files changed, 1 insertions, 7 deletions
diff --git a/src/com/android/camera/FocusOverlayManager.java b/src/com/android/camera/FocusOverlayManager.java
index ddbf39089..97909c1b8 100644
--- a/src/com/android/camera/FocusOverlayManager.java
+++ b/src/com/android/camera/FocusOverlayManager.java
@@ -383,7 +383,7 @@ public class FocusOverlayManager {
mState == STATE_SUCCESS || mState == STATE_FAIL)) {
cancelAutoFocus();
}
- if (mPreviewRect.width() == 0 || mPreviewRect.height() == 0) return;
+ if (mPreviewRect.isEmpty() || !mPreviewRect.contains(x, y)) return;
// Initialize variables.
// Initialize mFocusArea.
if (mFocusAreaSupported) {
diff --git a/src/com/android/camera/PhotoModule.java b/src/com/android/camera/PhotoModule.java
index bb0f1968e..d4b5e9567 100644
--- a/src/com/android/camera/PhotoModule.java
+++ b/src/com/android/camera/PhotoModule.java
@@ -2438,12 +2438,6 @@ public class PhotoModule
// we will update focus manager with proper UI.
if (mFocusManager != null && mUI != null) {
mFocusManager.setPhotoUI(mUI);
-
- View root = mUI.getRootView();
- // These depend on camera parameters.
- int width = root.getWidth();
- int height = root.getHeight();
- mFocusManager.setPreviewSize(width, height);
}
}