Revision 3051
trunk/libraries/libFMap/src/com/iver/cit/gvsig/fmap/core/v02/FConverter.java | ||
---|---|---|
769 | 769 |
|
770 | 770 |
return newGp; |
771 | 771 |
} |
772 |
public static FShape transformToInts(IGeometry gp, AffineTransform at) { |
|
772 |
public static synchronized FShape transformToInts(IGeometry gp, AffineTransform at) {
|
|
773 | 773 |
newGp.reset(); |
774 | 774 |
GeneralPathXIterator theIterator; |
775 | 775 |
int theType; |
... | ... | |
782 | 782 |
|
783 | 783 |
|
784 | 784 |
theIterator = gp.getGeneralPathXIterator(); //, flatness); |
785 |
int numSegmentsAdded = 0; |
|
785 | 786 |
while (!theIterator.isDone()) { |
786 | 787 |
theType = theIterator.currentSegment(theData); |
787 | 788 |
|
... | ... | |
793 | 794 |
antX = (int) ptDst.getX(); |
794 | 795 |
antY = (int) ptDst.getY(); |
795 | 796 |
newGp.moveTo(antX, antY); |
797 |
numSegmentsAdded++; |
|
796 | 798 |
bFirst = true; |
797 | 799 |
break; |
798 | 800 |
|
... | ... | |
807 | 809 |
antX = xInt; |
808 | 810 |
antY = yInt; |
809 | 811 |
bFirst = false; |
812 |
numSegmentsAdded++; |
|
810 | 813 |
} |
811 | 814 |
break; |
812 | 815 |
|
813 | 816 |
case PathIterator.SEG_QUADTO: |
814 | 817 |
at.transform(theData,0,aux,0,2); |
815 | 818 |
newGp.quadTo(aux[0], aux[1], aux[2], aux[3]); |
819 |
numSegmentsAdded++; |
|
816 | 820 |
break; |
817 | 821 |
|
818 | 822 |
case PathIterator.SEG_CUBICTO: |
819 | 823 |
at.transform(theData,0,aux,0,3); |
820 | 824 |
newGp.curveTo(aux[0], aux[1], aux[2], aux[3], aux[4], aux[5]); |
825 |
numSegmentsAdded++; |
|
821 | 826 |
break; |
822 | 827 |
|
823 | 828 |
case PathIterator.SEG_CLOSE: |
829 |
if (numSegmentsAdded < 3) |
|
830 |
newGp.lineTo(antX, antY); |
|
824 | 831 |
newGp.closePath(); |
825 | 832 |
|
826 | 833 |
break; |
Also available in: Unified diff