From 2f936e251c8e76d89b908041d0d1366e3bac576a Mon Sep 17 00:00:00 2001 From: mingwax Date: Tue, 29 Nov 2016 16:33:00 +0800 Subject: SnapdragonCamera: Path should be reseted in onLayout method When proMode is inVisible, onLayout method is called in the landscape screen, the screen will draw one more curve by path. Add judgment condition, path should be reseted in onLayout method. CRs-Fixed: 1094491 Change-Id: Id76e2234517bfef662b9687e997219e693e907b1 --- src/com/android/camera/ui/ProMode.java | 2 ++ 1 file changed, 2 insertions(+) diff --git a/src/com/android/camera/ui/ProMode.java b/src/com/android/camera/ui/ProMode.java index 9f7d576dc..dbd89ec58 100644 --- a/src/com/android/camera/ui/ProMode.java +++ b/src/com/android/camera/ui/ProMode.java @@ -156,12 +156,14 @@ public class ProMode extends View { super.onLayout(changed, left, top, right, bottom); mWidth = right - left; mHeight = bottom - top; + mCurveLeft = mWidth / 10; mCurveRight = mWidth - mCurveLeft; mCurveHeight = mWidth / 7; mCurveY = (int) (mHeight * 0.67); float cx = (mCurveLeft + mCurveRight) / 2; + mCurvePath.reset(); mCurvePath.moveTo(mCurveLeft, mCurveY); mCurvePath.quadTo(cx, mCurveY - mCurveHeight, mCurveRight, mCurveY); mCurveMeasure = new PathMeasure(mCurvePath, false); -- cgit v1.2.3