diff options
| author | Vijay kumar Tumati <vtumati@codeaurora.org> | 2013-09-10 15:00:57 +0530 |
|---|---|---|
| committer | Steve Kondik <shade@chemlab.org> | 2013-10-18 15:54:50 -0700 |
| commit | bcd875fd05ac405c17523be170f333da6f9fa6eb (patch) | |
| tree | 39ed0328d0c8645613d581aac2e878d8d3fcdd5a | |
| parent | 59b887e9929d76fb24cb9859902deb079bf2a95d (diff) | |
| download | android_packages_apps_Gallery2-bcd875fd05ac405c17523be170f333da6f9fa6eb.tar.gz android_packages_apps_Gallery2-bcd875fd05ac405c17523be170f333da6f9fa6eb.tar.bz2 android_packages_apps_Gallery2-bcd875fd05ac405c17523be170f333da6f9fa6eb.zip | |
Camera: Draw smile indicator based on display orientation
Without this, smile indicator is always drawn horizontally
which is a vertical line in 90 and 270 degree cases
CRs-Fixed: 539887
Change-Id: I320b90a7a8981075565171e69b64e7d3dc832a6f
| -rw-r--r-- | src/com/android/camera/ui/FaceView.java | 16 |
1 files changed, 12 insertions, 4 deletions
diff --git a/src/com/android/camera/ui/FaceView.java b/src/com/android/camera/ui/FaceView.java index 0596ce784..1701efc39 100644 --- a/src/com/android/camera/ui/FaceView.java +++ b/src/com/android/camera/ui/FaceView.java @@ -300,10 +300,18 @@ public class FaceView extends View if (face.mouth != null) { Log.e(TAG, "smile: " + face.getSmileDegree() + "," + face.getSmileScore()); if (face.getSmileDegree() < smile_threashold_no_smile) { - point[0] = face.mouth.x; - point[1] = face.mouth.y-delta_y +dy; - point[2] = face.mouth.x; - point[3] = face.mouth.y+delta_y + dy; + if ((mDisplayOrientation == 90) || (mDisplayOrientation == 270)) { + point[0] = face.mouth.x; + point[1] = face.mouth.y - delta_y + dy; + point[2] = face.mouth.x; + point[3] = face.mouth.y + delta_y + dy; + } + else { + point[0] = face.mouth.x + dx - delta_x; + point[1] = face.mouth.y; + point[2] = face.mouth.x + dx + delta_x ; + point[3] = face.mouth.y; + } mMatrix.mapPoints (point); canvas.drawLine(point[0] + dx, point[1] + dy, point[2] + dx, point[3] + dy, mPaint); |
