From 0c14639f9c93d875049f740599d27974c6453740 Mon Sep 17 00:00:00 2001 From: Jake McGinty Date: Thu, 30 Jul 2015 15:00:47 -0700 Subject: [PATCH] fix GB half-screen cropping Closes #3848 // FREEBIE --- .../securesms/components/camera/QuickCamera.java | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/src/org/thoughtcrime/securesms/components/camera/QuickCamera.java b/src/org/thoughtcrime/securesms/components/camera/QuickCamera.java index 36a4cfc2d3..4f4dde6470 100644 --- a/src/org/thoughtcrime/securesms/components/camera/QuickCamera.java +++ b/src/org/thoughtcrime/securesms/components/camera/QuickCamera.java @@ -8,6 +8,7 @@ import android.hardware.Camera.CameraInfo; import android.hardware.Camera.Parameters; import android.hardware.Camera.Size; import android.os.AsyncTask; +import android.os.Build.VERSION; import android.os.Build.VERSION_CODES; import android.support.annotation.NonNull; import android.util.AttributeSet; @@ -122,8 +123,14 @@ import java.util.List; } final float newWidth = visibleRect.width() * scale; final float newHeight = visibleRect.height() * scale; - final float centerX = previewWidth / 2; + final float centerX; final float centerY = previewHeight / 2; + if (VERSION.SDK_INT < VERSION_CODES.ICE_CREAM_SANDWICH) { + centerX = previewWidth - newWidth / 2; + } else { + centerX = previewWidth / 2; + } + visibleRect.set((int) (centerX - newWidth / 2), (int) (centerY - newHeight / 2), (int) (centerX + newWidth / 2),