frameworks/base
Revisión | d4c0f294aa9fdc7355cfe5f4d4489e053ceb6838 (tree) |
---|---|
Tiempo | 2017-10-13 18:34:48 |
Autor | Ladehunter <ladehunter@gmai...> |
Commiter | Chih-Wei Huang |
Fix bug of ForceOrientation
Signed-off-by: Ladehunter <ladehunter@gmail.com>
@@ -235,10 +235,11 @@ class DisplayContent { | ||
235 | 235 | || orientation == Surface.ROTATION_270); |
236 | 236 | final int physWidth = rotated ? mBaseDisplayHeight : mBaseDisplayWidth; |
237 | 237 | final int physHeight = rotated ? mBaseDisplayWidth : mBaseDisplayHeight; |
238 | + boolean forcedOrientation = mService.mPolicy.isDefaultOrientationForced(); | |
238 | 239 | int width = mDisplayInfo.logicalWidth; |
239 | - int left = (physWidth - width) / 2; | |
240 | + int left = forcedOrientation ? 0 : (physWidth - width) / 2; | |
240 | 241 | int height = mDisplayInfo.logicalHeight; |
241 | - int top = (physHeight - height) / 2; | |
242 | + int top = forcedOrientation ? 0 : (physHeight - height) / 2; | |
242 | 243 | out.set(left, top, left + width, top + height); |
243 | 244 | } |
244 | 245 |