JDK-4453725 : fillPolygon() broken
  • Type: Bug
  • Component: client-libs
  • Sub-Component: 2d
  • Affected Version: 1.3.0
  • Priority: P4
  • Status: Closed
  • Resolution: Duplicate
  • OS: solaris_8
  • CPU: sparc
  • Submitted: 2001-05-03
  • Updated: 2001-08-24
  • Resolved: 2001-08-22
The Version table provides details related to the release that this issue/RFE will be addressed.

Unresolved : Release in which this issue/RFE will be addressed.
Resolved: Release in which this issue/RFE has been resolved.
Fixed : Release in which this issue/RFE has been fixed. The release containing this fix may be available for download as an Early Access Release or a General Availability Release.

To download the current JDK release, click here.
Other
1.4.0Resolved
Related Reports
Duplicate :  
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
14-06-2004

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
21-08-2001