mirror of
				https://github.com/SimpleMobileTools/Simple-Camera.git
				synced 2025-06-27 09:02:59 +02:00 
			
		
		
		
	focus the middle of the screen if no other place was clicked
This commit is contained in:
		| @@ -322,8 +322,12 @@ class Preview : ViewGroup, SurfaceHolder.Callback, MediaScannerConnection.OnScan | |||||||
|             return |             return | ||||||
|  |  | ||||||
|         mCamera!!.cancelAutoFocus() |         mCamera!!.cancelAutoFocus() | ||||||
|         val focusRect = calculateFocusArea(mLastClickX.toFloat(), mLastClickY.toFloat()) |  | ||||||
|         if (mParameters!!.maxNumFocusAreas > 0) { |         if (mParameters!!.maxNumFocusAreas > 0) { | ||||||
|  |             if (mLastClickX == 0 && mLastClickY == 0) { | ||||||
|  |                 mLastClickX = width / 2 | ||||||
|  |                 mLastClickY = height / 2 | ||||||
|  |             } | ||||||
|  |             val focusRect = calculateFocusArea(mLastClickX.toFloat(), mLastClickY.toFloat()) | ||||||
|             val focusAreas = ArrayList<Camera.Area>(1) |             val focusAreas = ArrayList<Camera.Area>(1) | ||||||
|             focusAreas.add(Camera.Area(focusRect, 1000)) |             focusAreas.add(Camera.Area(focusRect, 1000)) | ||||||
|             mParameters!!.focusAreas = focusAreas |             mParameters!!.focusAreas = focusAreas | ||||||
|   | |||||||
		Reference in New Issue
	
	Block a user