You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@harmony.apache.org by "Denis Kishenko (JIRA)" <ji...@apache.org> on 2006/11/02 13:27:17 UTC
[jira] Updated: (HARMONY-2055) [class][awt] Graphics2D does wrong
translation on BufferedImage
[ http://issues.apache.org/jira/browse/HARMONY-2055?page=all ]
Denis Kishenko updated HARMONY-2055:
------------------------------------
Attachment: HARMONY-2055-actual.PNG
Actual screenshot
> [class][awt] Graphics2D does wrong translation on BufferedImage
> ---------------------------------------------------------------
>
> Key: HARMONY-2055
> URL: http://issues.apache.org/jira/browse/HARMONY-2055
> Project: Harmony
> Issue Type: Bug
> Components: Classlib
> Reporter: Denis Kishenko
> Attachments: HARMONY-2055-actual.PNG, HARMONY-2055-expected.PNG
>
>
> ============= Test ============
> import java.awt.BasicStroke;
> import java.awt.Color;
> import java.awt.Graphics;
> import java.awt.Graphics2D;
> import java.awt.event.WindowAdapter;
> import java.awt.event.WindowEvent;
> import java.awt.geom.AffineTransform;
> import java.awt.geom.Line2D;
> import java.awt.image.BufferedImage;
> import javax.swing.JFrame;
> public class bug9145 {
> static final boolean SCREEN = false;
>
> public static void main(String[] args) {
> JFrame f = new JFrame("Test") {
>
> void draw(Graphics g) {
> Graphics2D g2 = (Graphics2D)g;
> g.setColor(Color.blue);
> g2.draw(new Line2D.Float(20, 50, 80, 50));
> g.setColor(Color.red);
> g2.setTransform(AffineTransform.getTranslateInstance(5, 10));
> g2.draw(new Line2D.Float(20, 60, 80, 60));
> }
>
> public void paint(Graphics g) {
> if (SCREEN) {
> BufferedImage img = new BufferedImage(600, 400, BufferedImage.TYPE_INT_RGB);
> draw(img.getGraphics());
> g.drawImage(img, 0, 0, null);
> } else {
> draw(g);
> }
> }
> };
> f.addWindowListener(
> new WindowAdapter() {
> public void windowClosing(WindowEvent e) {
> System.exit(0);
> }
> }
> );
> f.setSize(100, 150);
> f.show();
> }
> }
--
This message is automatically generated by JIRA.
-
If you think it was sent incorrectly contact one of the administrators: http://issues.apache.org/jira/secure/Administrators.jspa
-
For more information on JIRA, see: http://www.atlassian.com/software/jira