diff options
author | Ivan Evlogiev <ivanevlogiev@codeaurora.org> | 2014-01-08 11:39:48 +0200 |
---|---|---|
committer | Ivan Evlogiev <ivanevlogiev@codeaurora.org> | 2014-03-11 11:11:16 -0700 |
commit | fafed380a5d85871e264f5ab9f4f659faeead733 (patch) | |
tree | 6a16b31e02b375455a65e7080372e867fe48e110 /src/com/android/camera/ui/FaceView.java | |
parent | e64c0dd0ae60c2c0fb045e6bd059b71ae222baa0 (diff) | |
download | android_packages_apps_Snap-fafed380a5d85871e264f5ab9f4f659faeead733.tar.gz android_packages_apps_Snap-fafed380a5d85871e264f5ab9f4f659faeead733.tar.bz2 android_packages_apps_Snap-fafed380a5d85871e264f5ab9f4f659faeead733.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 587195
Change-Id: I320b90a7a8981075565171e69b64e7d3dc832a6f
Diffstat (limited to 'src/com/android/camera/ui/FaceView.java')
-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 c89e14c82..d84510bab 100644 --- a/src/com/android/camera/ui/FaceView.java +++ b/src/com/android/camera/ui/FaceView.java @@ -310,10 +310,18 @@ public class FaceView extends View Log.e(TAG, "smile: " + face.getSmileDegree() + "," + face.getSmileScore()); if (face.getSmileDegree() < smile_threashold_no_smile) { - point[0] = face.mouth.x + dx; - point[1] = face.mouth.y-delta_y +dy; - point[2] = face.mouth.x + dx; - 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); |