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

Commit ef74ede0 authored by Diego Perez's avatar Diego Perez
Browse files

Handle case where canvas is 0x0 for shadows

Test: N/A
Change-Id: Ie837fb4097d7e1e47e8f96c73bb79ac8e7772a6b
parent 7c9e897c
Loading
Loading
Loading
Loading
+3 −0
Original line number Diff line number Diff line
@@ -127,6 +127,9 @@ public class RectShadowPainter {

    private static void paintGeometricShadow(@NonNull float[][] coordinates, float lightPosX,
            float lightPosY, float lightHeight, float lightSize, Canvas canvas) {
        if (canvas == null || canvas.getWidth() == 0 || canvas.getHeight() == 0) {
            return;
        }

        // The polygon of shadow (same as the original item)
        float[] shadowPoly = new float[coordinates.length * 3];