diff options
author | Jing (Mia) Wang <kaiyiz@codeaurora.org> | 2014-12-22 11:59:23 +0800 |
---|---|---|
committer | Jing (Mia) Wang <kaiyiz@codeaurora.org> | 2014-12-22 15:28:00 +0800 |
commit | b559313061bb42e5603bbf0e2e2de9399b2642c8 (patch) | |
tree | b11ba52d70e952e44e22d8aea94526793c040a1f /src | |
parent | 5c3a14e425dabf710b58c87c44a368469cbb5baf (diff) | |
download | android_packages_apps_Snap-b559313061bb42e5603bbf0e2e2de9399b2642c8.tar.gz android_packages_apps_Snap-b559313061bb42e5603bbf0e2e2de9399b2642c8.tar.bz2 android_packages_apps_Snap-b559313061bb42e5603bbf0e2e2de9399b2642c8.zip |
Camera: Draw mouth indicator based on display orientation
Without this, mouth indicator is always drawn horizontally
which is a vertical line in 90 and 270 degree cases.
CRs-Fixed: 773385
Change-Id: I3ff1cae10a3131691e447f8b4f4bcef9ebb2f26c
Diffstat (limited to 'src')
-rw-r--r-- | src/com/android/camera/ui/FaceView.java | 17 |
1 files changed, 12 insertions, 5 deletions
diff --git a/src/com/android/camera/ui/FaceView.java b/src/com/android/camera/ui/FaceView.java index 6181937ee..8013520a9 100644 --- a/src/com/android/camera/ui/FaceView.java +++ b/src/com/android/camera/ui/FaceView.java @@ -347,11 +347,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 - delta_x; - point[1] = face.mouth.y; - point[2] = face.mouth.x + delta_x ; - point[3] = face.mouth.y; + 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; + } Matrix faceMatrix = new Matrix(mMatrix); faceMatrix.preRotate(face.getRollDirection(), face.mouth.x, face.mouth.y); |