You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@harmony.apache.org by "Nellya Udovichenko (JIRA)" <ji...@apache.org> on 2007/08/24 15:31:32 UTC

[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

[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.


[jira] Updated: (HARMONY-4680) [classlib][awt] No correct result of java.awt.Graphics2D.scale() method use when the drawing figure is java.awt.geom.Area object

Posted by "Nellya Udovichenko (JIRA)" <ji...@apache.org>.
     [ https://issues.apache.org/jira/browse/HARMONY-4680?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Nellya Udovichenko updated HARMONY-4680:
----------------------------------------

    Attachment: H-4680-test.patch

Regression test for this issue

> [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
>            Assignee: Alexey Petrenko
>         Attachments: H-4680-test.patch, H-4680.patch
>
>
> 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.


[jira] Updated: (HARMONY-4680) [classlib][awt] No correct result of java.awt.Graphics2D.scale() method use when the drawing figure is java.awt.geom.Area object

Posted by "Nellya Udovichenko (JIRA)" <ji...@apache.org>.
     [ https://issues.apache.org/jira/browse/HARMONY-4680?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Nellya Udovichenko updated HARMONY-4680:
----------------------------------------

    Attachment: H-4680.patch

The test fails on Harmony because of the figure coordinates which are returned from AreaPathIterator.currentSegment() method, haven't been transformed. The patch for fix is attached. 

> [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
>         Attachments: H-4680.patch
>
>
> 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.


[jira] Closed: (HARMONY-4680) [classlib][awt] No correct result of java.awt.Graphics2D.scale() method use when the drawing figure is java.awt.geom.Area object

Posted by "Nellya Udovichenko (JIRA)" <ji...@apache.org>.
     [ https://issues.apache.org/jira/browse/HARMONY-4680?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Nellya Udovichenko closed HARMONY-4680.
---------------------------------------


Thank you, Alexey! I agree with your changes. Verified. Works well.

> [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
>            Assignee: Alexey Petrenko
>         Attachments: H-4680-test.patch, H-4680.patch
>
>
> 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.


[jira] Assigned: (HARMONY-4680) [classlib][awt] No correct result of java.awt.Graphics2D.scale() method use when the drawing figure is java.awt.geom.Area object

Posted by "Alexey Petrenko (JIRA)" <ji...@apache.org>.
     [ https://issues.apache.org/jira/browse/HARMONY-4680?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Alexey Petrenko reassigned HARMONY-4680:
----------------------------------------

    Assignee: Alexey Petrenko

> [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
>            Assignee: Alexey Petrenko
>         Attachments: H-4680.patch
>
>
> 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.


[jira] Resolved: (HARMONY-4680) [classlib][awt] No correct result of java.awt.Graphics2D.scale() method use when the drawing figure is java.awt.geom.Area object

Posted by "Alexey Petrenko (JIRA)" <ji...@apache.org>.
     [ https://issues.apache.org/jira/browse/HARMONY-4680?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Alexey Petrenko resolved HARMONY-4680.
--------------------------------------

    Resolution: Fixed

Nelly, I've slightly modified your patch before commit.
Please verify that you're agree with changes.

> [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
>            Assignee: Alexey Petrenko
>         Attachments: H-4680-test.patch, H-4680.patch
>
>
> 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.