static void subtractRect(int x11, int y11, int x12, int y12, int[] rect, int index, MultiRectArea dst) {

            for(int i = index; i < rect[0]; i += 4) {
                int x21 = rect[i + 0];
                int y21 = rect[i + 1];
                int x22 = rect[i + 2];
                int y22 = rect[i + 3];

                if (x11 <= x22 && x12 >= x21 && y11 <= y22 && y12 >= y21) {
                    int top, bottom;
                    if (y11 < y21) {
                        subtractRect(x11, y11, x12, y21 - 1, rect, i + 4, dst);
                        top = y21;
                    } else {
                        top = y11;
                    }
                    if (y12 > y22) {
                        subtractRect(x11, y22 + 1, x12, y12, rect, i + 4, dst);
                        bottom = y22;
                    } else {
                        bottom = y12;
                    }
                    if (x11 < x21) {
                        subtractRect(x11, top, x21 - 1, bottom, rect, i + 4, dst);
                    }
                    if (x12 > x22) {
                        subtractRect(x22 + 1, top, x12, bottom, rect, i + 4, dst);
                    }
                    return;
                }
            }
            dst.addRect(x11, y11, x12, y12);
        }