United StatesChange Country, Oracle Worldwide Web Sites Communities I am a... I want to...
JDK-4453725 : fillPolygon() broken

Details
Type:
Bug
Submit Date:
2001-05-03
Status:
Closed
Updated Date:
2001-08-24
Project Name:
JDK
Resolved Date:
2001-08-22
Component:
client-libs
OS:
solaris_8
Sub-Component:
2d
CPU:
sparc
Priority:
P4
Resolution:
Duplicate
Affected Versions:
1.3.0
Fixed Versions:
1.4.0

Related Reports
Duplicate:

Sub Tasks

Description
fillPolygon() is broken on java 1.3,, solaris/sparc.
Following program demonstrates the bug.
Draws a polygon and then fills the same polygon.  Use xmag to see detail.
It's easy to see the two don't match:

nairobi$ java -version
java version "1.3.0"
Java(TM) 2 Runtime Environment, Standard Edition (build 1.3.0)
Java HotSpot(TM) Client VM (build 1.3.0, mixed mode)
nairobi$ uname -a
SunOS nairobi 5.8 Generic_108528-01 sun4u sparc SUNW,Ultra-80
nairobi$ cat FillPolygon.java  
import java.awt.*;
import javax.swing.*;

public class FillPolygon extends JComponent {

    public void paint(Graphics g) {
        int x[] = new int[] {1, 8, 14,  8,  1};
        int y[] = new int[] {1, 1,  7, 13, 13};
        Polygon thumb = new Polygon(x, y, x.length);

        g.setColor(Color.green);
        g.fillRect(0, 0, 50, 50);

        g.setColor(Color.red);

        g.drawPolygon(thumb);
        g.translate( 15, 0 );
        g.fillPolygon(thumb); // BUG!
    }

    static public void main(String args[]) {
        JFrame f = new JFrame();
        f.getContentPane().add(new FillPolygon());
        f.setSize(100, 100);
        f.setVisible(true);
    }
}

                                    

Comments
CONVERTED DATA

BugTraq+ Release Management Values

COMMIT TO FIX:
merlin-beta3

FIXED IN:
merlin-beta3

INTEGRATED IN:
merlin-beta3


                                     
2004-06-14
EVALUATION

The results are a little more symmetrical under 1.4 and they agree with
our stated pixelization rules.  The Polygon renderer that was used in
1.3 was deleted in favor of the general Shape renderer which provides
more consistent rendering and a more compact footprint.

jim.graham@Eng 2001-07-23

The draw routines were honoring the STROKE_CONTROL hint, but the fill
routines were using the raw geometry as if the hint were set to STROKE_PURE
so there was a mismatch.  The fill routines were adjusted to perform
the same sub-pixel normalization as the draw routines when the
STROKE_CONTROL hint is set.

###@###.### 2001-08-21
                                     
2001-08-21



Hardware and Software, Engineered to Work Together