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: 6829659
Votes 0
Synopsis Circle is rendered in C shape
Category java:classes_2d
Reported Against
Release Fixed 7(b63)
State 10-Fix Delivered, bug
Priority: 4-Low
Related Bugs
Submit Date 13-APR-2009
Description
Bugzilla patch submission:
ScaleTest: A circle is rendered in a 'C' shape.
--------------------ScaleTest.java---------------------
import java.awt.*;
import java.awt.geom.Ellipse2D;
import java.awt.image.BufferedImage;
import java.io.File;
import javax.imageio.ImageIO;

/**
 * @author   xxxxx@xxxxx   (Chris Nokleberg)
 * @author   xxxxx@xxxxx   (Hiroshi Yamauchi)
 */
public class ScaleTest {
  public static void main(String[] args) throws Exception {
    BufferedImage image = new BufferedImage(200, 200, BufferedImage.TYPE_INT_RGB);
    Graphics2D g = image.createGraphics();

    g.setRenderingHint(RenderingHints.KEY_ANTIALIASING, RenderingHints.VALUE_ANTIALIAS_ON);
    g.setPaint(Color.WHITE);
    g.fill(new Rectangle(image.getWidth(), image.getHeight()));
    g.scale(.9, .9);
    g.setPaint(Color.BLACK);
    g.setStroke(new BasicStroke(0.5f));
    g.draw(new Ellipse2D.Double(25, 25, 150, 150));

    // To visually check it
    //ImageIO.write(image, "PNG", new File(args[0]));

    boolean nonWhitePixelFound = false;
    for (int x = 100; x < 200; ++x) {
      if (image.getRGB(x, 90) != Color.WHITE.getRGB()) {
        nonWhitePixelFound = true;
        break;
      }
    }
    if (!nonWhitePixelFound) {
      throw new RuntimeException("A circle is rendered like a 'C' shape.");
    }
  }
}
Posted Date : 2009-04-13 21:30:52.0
Work Around
N/A
Evaluation
See evaluation in the patch submitted by rkennke:
https://bugs.openjdk.java.net/show_bug.cgi?id=100030
Posted Date : 2009-04-17 17:19:55.0

New patch submitted by Hiroshi Yamauchi:
https://bugs.openjdk.java.net/show_bug.cgi?id=100030
Posted Date : 2009-05-21 17:40:13.0
Comments
  
  Include a link with my name & email   


PLEASE NOTE: JDK6 is formerly known as Project Mustang