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/08 15:46:59 UTC

[jira] Updated: (HARMONY-4612) [classlib][awt] The method java.awt.geom.Area.contains() returns no correct result if the parameter is the vertex of rhomb

     [ https://issues.apache.org/jira/browse/HARMONY-4612?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Nellya Udovichenko updated HARMONY-4612:
----------------------------------------

    Attachment: H-4612.patch

This method (Area.contains()) uses the methods of internal class org.apache.harmony.awt.gl.Crossing class.
The methods of Crossing class define how many times the ray directed down from the parameter point crosses the figure and return true if the point lies inside the figure using the gotten results of counting and the algorithms of even-odd or non-zero rules.

So if the ray crosses the figure in the vertex we have to count the intersection two times in different directions 
(counter-clockwise and clockwise) or to no count this intersection at once. In the attached patch it's suggested to no count such intersections. 

Now when the ray crosses the vertex of rhomb it is counted only one time in the method Crossing.crossLine() .

Please, could anybody verify the patch? 

> [classlib][awt]  The method java.awt.geom.Area.contains() returns no correct result if the parameter is the vertex of rhomb
> ---------------------------------------------------------------------------------------------------------------------------
>
>                 Key: HARMONY-4612
>                 URL: https://issues.apache.org/jira/browse/HARMONY-4612
>             Project: Harmony
>          Issue Type: Bug
>          Components: Classlib
>            Reporter: Nellya Udovichenko
>         Attachments: H-4612.patch
>
>
> Test:
> import java.awt.geom.Area;
> import java.awt.geom.GeneralPath;
> public class Test {
>     public static void main(String[] args) throws Exception{
> 		
>         GeneralPath path = new GeneralPath();
>         path.moveTo(50, 100);
>         path.lineTo(100, 50);
>         path.lineTo(150, 100);
>         path.lineTo(100, 150);
>         path.closePath();
>         
>         Area area = new Area(path);
>         
>         if (!area.contains(100, 50)) {
>         	System.out.println("PASSED");
>         } else {
>         	System.out.println("FAILED");
>         }
>     }       
> }
> RI output:
> PASSED
> Harmony output:
> FAILED

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