static void addSeg(MultiRectArea mra, int cx1, int cy1, int cx2, int cy2, int a, int b, int[] xline, int[] yline, int[] bounds) {
        switch(bounds[0]) {
        case 0:
            addY3LineSeg(mra, yline, cx2, cy1, a, bounds[1], bounds[2]);
            break;
        case 1:
            addX1LineSeg(mra, xline, cx2, cy1, b, bounds[1], bounds[2]);
            break;
        case 2:
            addX2LineSeg(mra, xline, cx1, cy1, b, bounds[1], bounds[2]);
            break;
        case 3:
            addY2LineSeg(mra, yline, cx1, cy1, a, bounds[1], bounds[2]);
            break;
        case 4:
            addY1LineSeg(mra, yline, cx1, cy2, a, bounds[1], bounds[2]);
            break;
        case 5:
            addX3LineSeg(mra, xline, cx1, cy2, b, bounds[1], bounds[2]);
            break;
        case 6:
            addX0LineSeg(mra, xline, cx2, cy2, b, bounds[1], bounds[2]);
            break;
        case 7:
            addY0LineSeg(mra, yline, cx2, cy2, a, bounds[1], bounds[2]);
            break;
        }
    }