private void makePath(Rectangle r1, Rectangle r2) {
        Rectangle rec = new Rectangle(0, 0, 0, 0);

        int cx1 = r1.x + r1.width / 2;
        int cx2 = r2.x + r2.width / 2;
        int cy1 = r1.y + r1.height / 2;
        int cy2 = r2.y + r2.height / 2;

        if (cx1 == cx2) {
            rec.x = cx1;
            rec.width = 1;
        } else if (cx1 < cx2) {
            rec.x = cx1;
            rec.width = cx2;
        } else {
            rec.x = cx2;
            rec.width = cx1;
        }

        if (cy1 == cy2) {
            rec.y = cy1;
            rec.height = 1;
        } else if (cy1 < cy2) {
            rec.y = cy1;
            rec.height = cy2;
        } else {
            rec.y = cy2;
            rec.height = cy1;
        }

        path(rec);
    }