Bug 16823 - java.awt.geom.RoundRectangle2D.intersects partially wrong
Summary: java.awt.geom.RoundRectangle2D.intersects partially wrong
Status: RESOLVED FIXED
Alias: None
Product: classpath
Classification: Unclassified
Component: awt (show other bugs)
Version: unspecified
: P2 normal
Target Milestone: pre-0.18
Assignee: graydon hoare
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2004-07-29 20:54 UTC by Mark Wielaard
Modified: 2005-10-16 01:54 UTC (History)
3 users (show)

See Also:
Host:
Target:
Build:
Known to work:
Known to fail:
Last reconfirmed:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description from-classpath 2004-01-07 09:58:58 UTC
Test case is in Mauve.

The current Classpath implementation says in a comment: "Here we can use the same code we use for an ordinary rectangle." This is wrong, because RoundRectangle2D is, well, rounded :-)

The implementation should cover the case where the intersection is only in the rounded corners, as in:

          |
-------\  |
        \ \
         \ \-------
          \
           |
           
In this case, the method should return false.
Comment 1 from-classpath 2004-01-07 10:00:55 UTC
Please use a fixed-with font for looking at the ASCII art in my previous comment.
Comment 2 Mark Wielaard 2004-07-29 20:54:33 UTC
The implementation of the intersects method in java.awt.geom.RoundRectangle2D
sometimes returns the wrong values.

The attached Mauve test case succeeds on Sun J2SE 1.4.1_01, but fails on
Classpath. I've just submitted this test case to
<mauve-patches@sources.redhat.com>. The enclosed image
(gnu/testlet/java/awt/geom/RoundRectangle2D/doc-files/intersects-1.png)
illustrates the expected results. [Testcase and picture are now in mauve]

For rectangles #10, 11, 12, 16, 20, 23, 27, 30, 34, 38, 39, and 40, the current
classpath implementation returns false. However, true would be the correct result.

This bug report comes from GNU Classpath:
https://savannah.gnu.org/bugs/index.php?func=detailitem&item_id=6067
Comment 3 from-classpath 2004-07-29 20:55:55 UTC
This bug is now also tracked in GCC AWT bugzilla:
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=16823
Comment 4 from-classpath 2004-08-01 23:13:01 UTC
Fixed.
Comment 5 from-classpath 2004-08-01 23:13:17 UTC
Fixed.
Comment 7 Andrew Pinski 2004-12-01 00:37:01 UTC
All of these are all fixed in 4.0.0 by the merge of the gui branch.