문제

I am writing my own PathIterator implementation.

Currently I implemented method with flatness with flatness-less one:

@Override
public PathIterator getPathIterator(AffineTransform at, double flatness) {
    return getPathIterator(at);
}

i.e. I am ignoring it.

What is the simplest way to work with flatness parameter?

My current iterator gives a series of parallel vertical lines (not connected between). How important for me to implement flatness-aware version of the iterator? Where is it used?

올바른 솔루션이 없습니다

다른 팁

The getPathIterator() cited should return only SEG_MOVETO, SEG_LINETO, and SEG_CLOSE segment types. If your Shape has no other segment types, e.g. SEG_CUBICTO or SEG_QUADTO, the flatness is irrelevant. As a concrete example, the Rectangle2D implementation specifies that "Since rectangles are already flat, the flatness parameter is ignored."

라이센스 : CC-BY-SA ~와 함께 속성
제휴하지 않습니다 StackOverflow
scroll top