diff options
author | Dan Stoza <stoza@google.com> | 2015-03-19 17:22:22 +0000 |
---|---|---|
committer | Gerrit Code Review <noreply-gerritcodereview@google.com> | 2015-03-19 17:22:23 +0000 |
commit | 55466b48504f9a904c54f3cae4fc1a43dec73a6c (patch) | |
tree | 34d498264d342c8bbfdb23f8315640cc8f5e91ae /libs/gui | |
parent | f87d1bcd65f1889b78a8f5db6526e91216eaeb5d (diff) | |
parent | 2632350ac88cdf007c62e18345b71411755ed6ba (diff) | |
download | frameworks_native-55466b48504f9a904c54f3cae4fc1a43dec73a6c.zip frameworks_native-55466b48504f9a904c54f3cae4fc1a43dec73a6c.tar.gz frameworks_native-55466b48504f9a904c54f3cae4fc1a43dec73a6c.tar.bz2 |
Merge "GLConsumer: Fix unsigned subtraction during crop"
Diffstat (limited to 'libs/gui')
-rw-r--r-- | libs/gui/GLConsumer.cpp | 12 |
1 files changed, 6 insertions, 6 deletions
diff --git a/libs/gui/GLConsumer.cpp b/libs/gui/GLConsumer.cpp index 065345c..a0f68b4 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]", |