Java Solaris Communities Sun Store Join SDN My Profile Why Join?
 
Bug Database
Bug Detail
Quick Lists
Top 25 Bugs
Top 25 RFE's
Recently Closed Bugs
Printable Page Printable Page


Bug Database
Bug ID: 4136042
Votes 4
Synopsis In Graphics class drawArc() and fill3DRect() are not quite right
Category java:classes_2d
Reported Against 1.1.3 , 1.1.5
Release Fixed
State 6-Fix Understood, bug
Priority: 4-Low
Related Bugs 4076974
Submit Date 07-MAY-1998
Description


import java.awt.*;
import java.awt.event.*;

public class DrawRectTest extends Frame implements WindowListener {
	public DrawRectTest() {
		super();
		addWindowListener(this);
	}
	
	public void windowClosing(WindowEvent e) {
		System.exit(0);
	}

	public void windowClosed(WindowEvent e) {}
	public void windowActivated(WindowEvent e) {}
	public void windowDeactivated(WindowEvent e) {}
	public void windowDeiconified(WindowEvent e) {}
	public void windowIconified(WindowEvent e) {}
	public void windowOpened(WindowEvent e) {}

	public void paint(Graphics g ) {
		g.setColor(Color.red);

// To draw arc starting 0 degree to 1 or 2 degree, I get a whole circle
		g.drawArc(60, 60, 20, 20, 0, -2); // arcAngle = -2 to 2 
		g.drawArc(60, 90, 30, 30, 0, -1); // arcAngle = -1 to 1
		g.drawArc(60, 140, 40, 40, 0, -1);
		g.drawArc(60, 200, 50, 50, 0, -1);
		g.drawArc(60, 260, 60, 57, 0, -1);

// The 3D Rectangle is flipped when given negative width or height, but
//  fillRect() is not like this. Why does it need to change position?

		g.fillRect(100, 80, -10, -50);
		g.fillRect(100, 80, 10, 50);
		g.fill3DRect(200, 155, 40, 40, false);
		g.fill3DRect(200, 155, -40, -40, false);
//		g.draw3DRect(200, 100, -200, 400, true);
//		g.fillRoundRect(100, 50, 200, 400, -1000, 100);
	}

	public static void main(String[] args) {
		Frame drawRect = new DrawRectTest();
		drawRect.setSize(200, 200);
		drawRect.show();
	}

}
(Review ID: 23948)
======================================================================
Posted Date : 2005-10-08 02:15:28.0
Work Around
N/A
Evaluation



R Chandrasekar / SIPTech (  xxxxx@xxxxx  )  July 01, 1998

     This is a valid bug.
     It exists in the following

               jdk1.1.6 for Solaris 2.6 ( Sparc )
               jdk1.1.6 for Solaris 2.5 ( x86 )

               jdk1.2beta4-build J  for Solaris 2.6 ( Sparc )
               jdk1.2beta3 for Solaris ( x86 )

               jdk1.1.6 for win32
               jdk1.2beta4 build H for win32


======================================================================




R Chandrasekar / SIPTech (  xxxxx@xxxxx  )  July 01, 1998

     This is a valid bug.
     It exists in the following

               jdk1.1.6 for Solaris 2.6 ( Sparc )
               jdk1.1.6 for Solaris 2.5 ( x86 )

               jdk1.2beta4-build J  for Solaris 2.6 ( Sparc )
               jdk1.2beta3 for Solaris ( x86 )

               jdk1.1.6 for win32
               jdk1.2beta4 build H for win32

====================================================================== 

Even though this predates 1.2, 2D usually prefers to handle these issues.  
  xxxxx@xxxxx   2002-06-11
Posted Date : 2005-10-08 02:15:28.0

The verifications listed are not very specific as this bug tests more
than one problem.

On Solaris (which uses X11 for the test case), I do not see any arc
failures on any release, but I do see failures in draw3DRect in the
1.1 releases.  These failures seem to be fixed as early as 1.2.2 so
that Solaris passes all of the tests on 1.2.2 and later releases.

On Windows (which uses GDI for the test case), I see arc failures
on all releases up to the current release (Mustang), and the draw3DRect
failures are the same on Solaris (fixed on 1.2.2 and later).

Thus, the only remaining bug here is Windows GDI rendering of small
arc sizes.  The cause of that bug is due to the Windows API for
rendering arcs (::Arc) which uses points with integer coordinates
to define where the arc starts and ends.  The problem is, that for
small arc sizes, the two points that start and end the arc are so
close together that they map to the same integer coordinates and
Windows interprets that case as "draw the full arc".  The fix here
would be to make sure that the points which define the start and
end of the arc are at a sufficiently large radius that they do not
map to the same point with integer coordinates.
Posted Date : 2005-10-08 02:15:28.0
Comments
  
  Include a link with my name & email   


PLEASE NOTE: JDK6 is formerly known as Project Mustang