Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 5bebe7e1 authored by Dan Stoza's avatar Dan Stoza Committed by Android Git Automerger
Browse files

am 55466b48: Merge "GLConsumer: Fix unsigned subtraction during crop"

* commit '55466b48':
  GLConsumer: Fix unsigned subtraction during crop
parents e31591ba 55466b48
Loading
Loading
Loading
Loading
+6 −6
Original line number Original line Diff line number Diff line
@@ -899,14 +899,14 @@ Rect GLConsumer::getCurrentCrop() const {


        // The crop is too wide
        // The crop is too wide
        if (newWidth < currentWidth) {
        if (newWidth < currentWidth) {
            uint32_t dw = (newWidth - currentWidth) / 2;
            uint32_t dw = (currentWidth - newWidth) / 2;
            outCrop.left -=dw;
            outCrop.left += dw;
            outCrop.right += dw;
            outCrop.right -= dw;
        // The crop is too tall
        // The crop is too tall
        } else if (newHeight < currentHeight) {
        } else if (newHeight < currentHeight) {
            uint32_t dh = (newHeight - currentHeight) / 2;
            uint32_t dh = (currentHeight - newHeight) / 2;
            outCrop.top -= dh;
            outCrop.top += dh;
            outCrop.bottom += dh;
            outCrop.bottom -= dh;
        }
        }


        GLC_LOGV("getCurrentCrop final crop [%d,%d,%d,%d]",
        GLC_LOGV("getCurrentCrop final crop [%d,%d,%d,%d]",