4197755: Arc2D.getBounds() returns an unnecessarily large bounding box #26715
+100
−14
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
4197755 is marked as a duplicate of JDK-8176501 , but I think that is a mistake. The complaint in that ticket still reproduces, and it is resolved in this PR.
The complaint is: Arc2D.getBounds() is too large. If an Arc2D represents a small slice of an ellipse, then Arc2D.getBounds() always returns the size of the total ellipse. Arc2D.getBounds2D(), by contrast, has been "high-precision" for decades.
This PR makes Arc2D.getBounds() resemble the same implementation already used in Area, CubicCurve2D, Line2D, Path2D, and QuadCurve2D:
This modifies (simplifies) the javadoc for Arc2D.getBounds2D(). If we generally like this PR I assume we'll need a CSR to approve the javadoc change.
Progress
Issue
Reviewing
Using
git
Checkout this PR locally:
$ git fetch https://git.openjdk.org/jdk.git pull/26715/head:pull/26715
$ git checkout pull/26715
Update a local copy of the PR:
$ git checkout pull/26715
$ git pull https://git.openjdk.org/jdk.git pull/26715/head
Using Skara CLI tools
Checkout this PR locally:
$ git pr checkout 26715
View PR using the GUI difftool:
$ git pr show -t 26715
Using diff file
Download this PR as a diff file:
https://git.openjdk.org/jdk/pull/26715.diff
Using Webrev
Link to Webrev Comment