private void appendPath(GeneralPath gp1, GeneralPath gp2, boolean reversed) {
        ArrayList<Number[]> points = new ArrayList<Number[]>(); // Each element is an array consisting of one Integer and six Floats

        PathIterator i = gp2.getPathIterator(new AffineTransform());

        float[] segment = new float[]{0.0f, 0.0f, 0.0f, 0.0f, 0.0f, 0.0f};

        float leftmost = Float.POSITIVE_INFINITY;

        while (!i.isDone()) {
            int type = i.currentSegment(segment);
            i.next();

            points.add(new Number[]{
                        new Integer(type),
                        new Float(segment[0]),
                        new Float(segment[1]),
                        new Float(segment[2]),
                        new Float(segment[3]),
                        new Float(segment[4]),
                        new Float(segment[5])
                    });
        }

        if (!reversed) {
            float deltaX = (float) gp1.getCurrentPoint().getX() - ((Float) points.get(0)[1]).floatValue();
            float deltaY = (float) gp1.getCurrentPoint().getY() - ((Float) points.get(0)[2]).floatValue();

            for (int j = 1; j < points.size(); j++) {
                Object[] typeAndPoints = points.get(j);

                int type = ((Integer) typeAndPoints[0]).intValue();
                float x1 = ((Float) typeAndPoints[1]).floatValue();
                float y1 = ((Float) typeAndPoints[2]).floatValue();
                float x2 = ((Float) typeAndPoints[3]).floatValue();
                float y2 = ((Float) typeAndPoints[4]).floatValue();
                float x3 = ((Float) typeAndPoints[5]).floatValue();
                float y3 = ((Float) typeAndPoints[6]).floatValue();

                if (type == PathIterator.SEG_MOVETO) {
                } else if (type == PathIterator.SEG_LINETO) {
                    gp1.lineTo(x1 + deltaX, y1 + deltaY);

                    leftmost = Math.min(leftmost, x1 + deltaX);
                } else if (type == PathIterator.SEG_QUADTO) {
                    gp1.quadTo(x1 + deltaX, y1 + deltaY, x2 + deltaX, y2 + deltaY);

                    leftmost = Math.min(leftmost, x2 + deltaX);
                } else if (type == PathIterator.SEG_CUBICTO) {
                    gp1.curveTo(x1 + deltaX, y1 + deltaY, x2 + deltaX, y2 + deltaY, x3 + deltaX, y3 + deltaY);

                    leftmost = Math.min(leftmost, x3 + deltaX);
                } else {
                    assert false : type;
                }
            }
        }
    }