private void updateGrid() {
        // Draw the shadow (previous should already have been removed)
        if (displayShadow) {
            shadowDistance = 0;

            boolean canMoveDown = true;

            // Drop the shadow to calculate new distance
            while (true) {
                for (int[] relLoc : relLocs) {
                    if (relLoc[1] + row - shadowDistance <= 0
                        || grid.isOccupied(relLoc[0] + col, relLoc[1] + row
                            - shadowDistance - 1)
                        && !isSelfOccupied(relLoc[0] + col, relLoc[1] + row
                            - shadowDistance - 1)) {
                        canMoveDown = false;
                        break;
                    }
                }

                if (!canMoveDown) {
                    break;
                }

                ++shadowDistance;
            }

            for (int[] relLoc : relLocs) {
                grid.set(relLoc[0] + col, relLoc[1] + row - shadowDistance,
                    SquareType.SHADOW);
            }
        }

        // Place this tetromino in the grid (overlaps shadow)
        for (int[] relLoc : relLocs) {
            grid.set(relLoc[0] + col, relLoc[1] + row, type);
        }
    }