summaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorLinux Build Service Account <lnxbuild@localhost>2017-01-05 13:57:26 -0800
committerGerrit - the friendly Code Review server <code-review@localhost>2017-01-05 13:57:26 -0800
commit440786174f21f91ce93ce99f23ddbbbedd62af87 (patch)
tree52d84738eca94a2865940c2b2432d4d23bf13750 /src
parent2228b65de460d7dad2fffcf1f97f78ee741fe3a9 (diff)
parentdf644374b03720135ee94218b7e318d79211f57a (diff)
downloadandroid_packages_apps_Snap-440786174f21f91ce93ce99f23ddbbbedd62af87.tar.gz
android_packages_apps_Snap-440786174f21f91ce93ce99f23ddbbbedd62af87.tar.bz2
android_packages_apps_Snap-440786174f21f91ce93ce99f23ddbbbedd62af87.zip
Merge "SnapdragonCamera: ROI circle becomes oval when start/stop recording" into camera.lnx.1.0-dev.1.0
Diffstat (limited to 'src')
-rw-r--r--src/com/android/camera/ui/Camera2FaceView.java11
1 files changed, 9 insertions, 2 deletions
diff --git a/src/com/android/camera/ui/Camera2FaceView.java b/src/com/android/camera/ui/Camera2FaceView.java
index 40a3469aa..ea75c65e2 100644
--- a/src/com/android/camera/ui/Camera2FaceView.java
+++ b/src/com/android/camera/ui/Camera2FaceView.java
@@ -111,7 +111,6 @@ public class Camera2FaceView extends FaceView {
translateMatrix.postScale(2000f / mCameraBound.width(), 2000f / mCameraBound.height());
int dx = (getWidth() - rw) / 2;
- ;
int dy = (getHeight() - rh) / 2;
// Focus indicator is directional. Rotate the matrix and the canvas
@@ -119,6 +118,10 @@ public class Camera2FaceView extends FaceView {
canvas.save();
mMatrix.postRotate(mOrientation); // postRotate is clockwise
canvas.rotate(-mOrientation); // rotate is counter-clockwise (for canvas)
+
+ float rectWidth;
+ float rectHeight;
+ float diameter;
for (int i = 0; i < mFaces.length; i++) {
if (mFaces[i].getScore() < 50) continue;
Rect faceBound = mFaces[i].getBounds();
@@ -129,7 +132,11 @@ public class Camera2FaceView extends FaceView {
mPaint.setColor(mColor);
mRect.offset(dx, dy);
- canvas.drawOval(mRect, mPaint);
+ rectHeight = mRect.bottom-mRect.top;
+ rectWidth = mRect.right - mRect.left;
+ diameter = rectHeight > rectWidth ? rectWidth : rectHeight;
+
+ canvas.drawCircle(mRect.centerX(), mRect.centerY(), diameter/2, mPaint);
}
canvas.restore();
}