harmony-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Nellya Udovichenko (JIRA)" <j...@apache.org>
Subject [jira] Created: (HARMONY-4680) [classlib][awt] No correct result of java.awt.Graphics2D.scale() method use when the drawing figure is java.awt.geom.Area object
Date Fri, 24 Aug 2007 13:31:32 GMT
[classlib][awt] No correct result of java.awt.Graphics2D.scale() method use when the drawing
figure is java.awt.geom.Area object
--------------------------------------------------------------------------------------------------------------------------------

                 Key: HARMONY-4680
                 URL: https://issues.apache.org/jira/browse/HARMONY-4680
             Project: Harmony
          Issue Type: Bug
          Components: Classlib
            Reporter: Nellya Udovichenko


After the test launching we get
at RI: 2 figures - red and blue ellipses;
at Harmony: 3 figures: cyan, red and blue ellipses;

But the blue ellipse has to be transformed. So it covers the cyan one.

Test:
import java.awt.BorderLayout;
import java.awt.Color;
import java.awt.Graphics;
import java.awt.Graphics2D;
import java.awt.geom.Area;
import java.awt.geom.Ellipse2D;

import javax.swing.*;

public class Test extends JPanel {

    protected void paintComponent(Graphics g) {
        Graphics2D g2 = (Graphics2D) g;
        g2.scale(200.0 / 100.0, 200.0 / 140.0);
        
        Ellipse2D circle = new Ellipse2D.Double(25, 70, 50.0, 50.0);
        g2.setColor(Color.cyan);
        g2.draw(circle);
        Ellipse2D oval = new Ellipse2D.Double(30, 50, 40.0, 70.0);
        g2.setColor(Color.red);
        g2.draw(oval);
        Area ar = new Area(circle);
        g2.setColor(Color.blue);
        g2.draw(ar);
    }

    public static void main(String[] args) {
        JFrame frame = new JFrame();
        frame.getContentPane().setLayout(new BorderLayout());
        frame.getContentPane().add(new PolygonTest());
        frame.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
        frame.setSize(800, 600);
        frame.setVisible(true);
    }
}


-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.


Mime
View raw message