bug-classpath
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Bug classpath/29386] New: Arc2D.getPathIterator returns reverse path wh


From: ujihara at aurora dot dti dot ne dot jp
Subject: [Bug classpath/29386] New: Arc2D.getPathIterator returns reverse path when the extent is negative.
Date: 8 Oct 2006 17:59:59 -0000

Arc2D.getPathIterator(null) returns reverse path when the extent of Arc2D
object is negative. For example, the following program outputs
  100.0 50.0
  100.0 77.614235 77.614235 100.0 50.0 100.0
in Java, but the same program outputs 
  50.0 100.0
  77.61423 100.0 100.0 77.61423 100.0 50.0
in GNU Classpath 0.91. 

import java.awt.*;
import java.awt.geom.*;

public class Program
{
    public static void main(String[] args)
    {
        Arc2D a = new Arc2D.Float(0, 0, 100, 100, 0, -90, Arc2D.OPEN);
        float[] ff = new float[6];
        for (PathIterator pi = a.getPathIterator(null); !pi.isDone(); )
        {
            int type = pi.currentSegment(ff);
            int n = 0;
            switch (type)
            {
                case PathIterator.SEG_MOVETO:
                case PathIterator.SEG_LINETO:
                    n = 1;
                    break;
                case PathIterator.SEG_QUADTO:
                    n = 2;
                    break;
                case PathIterator.SEG_CUBICTO:
                    n = 3;
                    break;
                default:
                    throw new InternalError();                
            }
            for (int i = 0; i < n; i++)
            {
                System.out.print(ff[i*2]);
                System.out.print(" ");
                System.out.print(ff[i*2+1]);
                System.out.print(" ");
            }
            System.out.println();
            pi.next();
        }
    }
}


-- 
           Summary: Arc2D.getPathIterator returns reverse path when the
                    extent is negative.
           Product: classpath
           Version: 0.91
            Status: UNCONFIRMED
          Severity: normal
          Priority: P3
         Component: classpath
        AssignedTo: unassigned at gcc dot gnu dot org
        ReportedBy: ujihara at aurora dot dti dot ne dot jp


http://gcc.gnu.org/bugzilla/show_bug.cgi?id=29386





reply via email to

[Prev in Thread] Current Thread [Next in Thread]