summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--libs/gui/GLConsumer.cpp12
1 files changed, 6 insertions, 6 deletions
diff --git a/libs/gui/GLConsumer.cpp b/libs/gui/GLConsumer.cpp
index 065345c2b8..a0f68b4c1f 100644
--- a/libs/gui/GLConsumer.cpp
+++ b/libs/gui/GLConsumer.cpp
@@ -899,14 +899,14 @@ Rect GLConsumer::getCurrentCrop() const {
// The crop is too wide
if (newWidth < currentWidth) {
- uint32_t dw = (newWidth - currentWidth) / 2;
- outCrop.left -=dw;
- outCrop.right += dw;
+ uint32_t dw = (currentWidth - newWidth) / 2;
+ outCrop.left += dw;
+ outCrop.right -= dw;
// The crop is too tall
} else if (newHeight < currentHeight) {
- uint32_t dh = (newHeight - currentHeight) / 2;
- outCrop.top -= dh;
- outCrop.bottom += dh;
+ uint32_t dh = (currentHeight - newHeight) / 2;
+ outCrop.top += dh;
+ outCrop.bottom -= dh;
}
GLC_LOGV("getCurrentCrop final crop [%d,%d,%d,%d]",