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

Commit 146f0412 authored by Romain Guy's avatar Romain Guy Committed by Android Git Automerger
Browse files

am 21ff8c9c: am 1460c8ca: Merge "Prevent possible divide by 0 Bug #7307304" into jb-mr1-dev

* commit '21ff8c9c':
  Prevent possible divide by 0 Bug #7307304
parents 9068e1b6 21ff8c9c
Loading
Loading
Loading
Loading
+2 −2
Original line number Original line Diff line number Diff line
@@ -134,7 +134,7 @@ void Patch::updateVertices(const float bitmapWidth, const float bitmapHeight,
        const float fixed = bitmapWidth - stretchSize;
        const float fixed = bitmapWidth - stretchSize;
        const float xStretch = fmaxf(right - left - fixed, 0.0f);
        const float xStretch = fmaxf(right - left - fixed, 0.0f);
        stretchX = xStretch / xStretchTex;
        stretchX = xStretch / xStretchTex;
        rescaleX = fminf(fmaxf(right - left, 0.0f) / fixed, 1.0f);
        rescaleX = fixed == 0.0f ? 0.0f : fminf(fmaxf(right - left, 0.0f) / fixed, 1.0f);
    }
    }


    if (yStretchCount > 0) {
    if (yStretchCount > 0) {
@@ -146,7 +146,7 @@ void Patch::updateVertices(const float bitmapWidth, const float bitmapHeight,
        const float fixed = bitmapHeight - stretchSize;
        const float fixed = bitmapHeight - stretchSize;
        const float yStretch = fmaxf(bottom - top - fixed, 0.0f);
        const float yStretch = fmaxf(bottom - top - fixed, 0.0f);
        stretchY = yStretch / yStretchTex;
        stretchY = yStretch / yStretchTex;
        rescaleY = fminf(fmaxf(bottom - top, 0.0f) / fixed, 1.0f);
        rescaleY = fixed == 0.0f ? 0.0f : fminf(fmaxf(bottom - top, 0.0f) / fixed, 1.0f);
    }
    }


    TextureVertex* vertex = mVertices;
    TextureVertex* vertex = mVertices;